Skip to content

AA08: proposeAgent tool: validate, catalog checks, requirements, card output - #855

Merged
LinuxDevil merged 1 commit into
mainfrom
fb-aa08-propose-agent
Nov 3, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
fb-aa08-propose-agent

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

What changed

proposeAgent({ draft }) — the Author's create-proposal tool. It validates the draft via AA07's draftToSpec, checks every catalog-referenced value (model + fallback models, builtin tools, guardrail names, trigger types, subagents.<key>.ref and handoffs[i].agent against workspace agent ids) in a single failure that lists up to 10 problems with the first problem's code, computes the card's readiness rows via the requirements dep ([] on dep error), runs the injected reviewDraft (passReview until the real review lands), records the card under the 'create' identity in per-turn proposal state, and returns the ProposalOutput. proposalId is the call's toolCallId; nothing is written to disk.

New modules under server/author/proposal/:

  • turnState.ts — ProposalIdentity, identityKey, ProposalTurnState, proposalTurnState (lazily stored in turn.state['proposals']).
  • review.ts — ReviewInput/ReviewVerdict/ReviewDraft contract + passReview default.
  • catalogChecks.ts — CatalogFacts, loadCatalogFacts (memoized per turn in turn.state['catalogFacts']), checkCatalogs.

Also:

  • shared/authorWire.ts — ProposalKind, ProposalOutput; SpecChange re-exported alongside Requirement.
  • tools/index.ts — AuthorToolDeps gains reviewDraft and requirements; proposeAgentTool registered in AUTHOR_TOOL_FACTORIES (now 14 tools).
  • app.ts — createApp wires reviewDraft: passReview and requirements to computeRequirements with requirementDeps resolved per call against the session's workspace root (workspace seam preserved).

How it was tested

  • npm run typecheck:server, npm run typecheck — clean.
  • npm run test:server — 1020 tests pass (76 files), incl. new proposeAgent.test.ts (8) and catalogChecks.test.ts (14).
  • npm test -- --run — 946 client tests pass.
  • Root: npx tsc --noEmit, npm run lint, npm run lint --workspace apps/agent-forge (0 errors), npm run test:coverage (7152 pass; coverage report written), npm run fallow (0 above threshold), npm run docs:ratchet, npm run api:check, npm run docs:llms:check, npm run size-check — all green.
  • Note: the first test:coverage run showed 11 failures unrelated to this diff — 5 in packages/create-lousho (its dist/ was unbuilt) and 6 src/spec/v2/templates.test.ts README assertions caused by CRLF checkout line endings on Windows. Both were environmental; after building the sibling package and normalizing the checkouts to LF, the full suite passes with 0 failures. No content changes were committed for either.

Acceptance criteria

  • A valid draft returns ok: true with proposalId === ctx.toolCallId, kind: 'create', enabled: false, a chat trigger present, and nothing written to .lousho/agents/.
  • A draft with an unknown model and an unknown tool returns one UNKNOWN_MODEL failure listing both problems.
  • A review returning pass: false makes the tool return that failure and leaves proposed empty.
  • After a successful call proposalTurnState(turn).proposed.get('create') is the output.

Generated with Devin

…rements, card output

proposeAgent({ draft }) validates a new-agent draft against AgentSpec v2
(draftToSpec), checks the live catalogs (models, builtin tools,
guardrails, trigger types, agent refs) in one failure listing all
problems, computes advisory requirements, runs the pluggable review
(passReview until the real review lands), records the card in per-turn
proposal state keyed by identity, and returns a ProposalOutput the panel
renders. proposalId is the call's toolCallId; nothing is written.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil force-pushed the fb-aa08-propose-agent branch from 4758dc3 to 2090fe5 Compare November 3, 2026 03:55
@LinuxDevil
LinuxDevil merged commit 9d43f28 into main Nov 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant