Repository navigation
AA13: Requirements service (readiness of a spec) - #853
Merged
Merged
Conversation
computeRequirements(spec, deps) lists what a spec v2 needs to run - provider key, named secrets, env vars, models, MCP servers, builtin and registry tools, local files - each ok, missing or unknown, with a fix where one exists. Never throws (one log line, returns []), never blocks a save; labels name things, never secret values. - Requirement wire type next to RequirementKind in shared/wireTypes.ts, re-exported from shared/authorWire.ts; AgentRecord.requirements added. - server/author/requirements.ts: providerRows, modelRows, secretRefRows (deep walk, skips instructions), mcpRows, toolRows, fileRows; sorted missing/unknown/ok then id, deduped by id. - requirementDeps(root, secrets) builds prod deps per call from the workspace context; fileExists resolves under the workspace root and refuses traversal/absolute escapes. - GET /agents/:id/requirements -> Requirement[] | 404; GET /agents/:id now embeds record.requirements. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
computeRequirements(spec, deps)— the readiness list of a spec v2: provider key, models in the catalog, named secrets and env vars its{ secret }/{ env }refs resolve to, MCP servers, builtin/registry tools and local files, eachok,missingorunknownwith a fix where one exists. It never throws (an internal error logs one line and returns[]) and never blocks a save. Labels name things, never secret values.shared/wireTypes.ts:Requirementinterface next to the existingRequirementKind;AgentRecord.requirements?: Requirement[]added. Re-exported fromshared/authorWire.ts.server/author/requirements.ts(new):RequirementDeps,computeRequirements(providerRows, modelRows, secretRefRows with a deep walk that skipsinstructions, mcpRows, toolRows, fileRows; sorted missing → unknown → ok then by id, deduped by id) andrequirementDeps(root, secrets)— the production deps, built per call sofileExistsresolves under the request's workspace root and reportsmissingfor traversal/absolute paths without stat-ing outside it.GET /agents/:id/requirements→Requirement[](404{ error: 'Agent not found.' }), andGET /agents/:idnow embedsrecord.requirements.getSecret(name)(the ticket'shasNamed); provider keys viagetKey+PROVIDER_KEY_ENV,openrouter/googlevia their env vars,ollama/mockkeyless, anything elseunknown.How tested
npm run typecheck:server— cleannpm run test:server— 74 files / 997 tests pass (28 new: one case per rules-table row, dedupe, ordering, throw path, path escape; route 200/404)npm run typecheck,npm test -- --run(946),npm run lint --workspace apps/agent-forge(0 errors)npx tsc --noEmit,npm run lint,npm run test:coverage(7163 pass; needednpm run build -w create-loushoin the fresh worktree for its dist-dependent tests),npm run fallow(0 issues, 0 above threshold),npm run docs:ratchet,npm run api:check,npm run docs:llms:check,npm run size-check— all passPre-existing/environmental notes: on this Windows checkout,
templates/*/README.mdare smudged to CRLF bycore.autocrlf, which made 6src/spec/v2/templates.test.tsassertions fail on the first coverage run (unrelated to this change; passes with LF bytes). The known runRegistry flake did not reproduce.Acceptance criteria
model: anthropic/…, no stored key, no env → oneprovider:anthropicmissing row with the settings fix{ secret: 'GITHUB_TOKEN' }nested insidemcpServers.gh.envis found once even if referenced twice../../etc/passwdis reported missing and never stat-ed outsidebaseDir[], not a throwGenerated with Devin