Skip to content

feat: harness gates for autonomous end-to-end delivery#80

Merged
chen201724 merged 7 commits into
feat/harness-improvementsfrom
feat/harness-gates
Jul 14, 2026
Merged

feat: harness gates for autonomous end-to-end delivery#80
chen201724 merged 7 commits into
feat/harness-improvementsfrom
feat/harness-gates

Conversation

@chen201724

Copy link
Copy Markdown
Member

Summary

Stacked on #79. Builds the harness up so a less capable agent can reliably run the full requirement → develop → test → verify → PR loop. The theme: convert judgment into procedure, convert convention into machine checks.

  • Single-command quality gate: npm run check = lint + format:check + typecheck + test + build. "Done" is now exit code 0 of one command, and CI runs the same command so local and CI feedback cannot drift. .nvmrc pins Node; AGENTS.md documents environment bootstrap (npm ci first, and on any command not found).
  • Docs-code sync becomes an executable invariant: new tests/mcp/capability-scope-docs.test.ts diffs the tool list and the declared "N 个 MCP tools" count in docs/capability-scope.md against the live tools/list registry. The "update the doc when you change the surface" rule no longer relies on discipline. Verified negatively: injected doc drift fails with a message telling the fixer exactly what to update.
  • Guided contract failures: tool-registry-contract.test.ts assertions now say, on failure, what to update if the change is intentional (contract tables, call-contract tests, capability-scope doc, breaking-change declaration) and what was broken if not.
  • Step-by-step workflows: docs/workflows/{add-tool,modify-tool,fix-bug}.md give exact file-by-file recipes for the three dominant change types, including the breaking-change rubric. Linked from AGENTS.md and docs/README.md.
  • Safe real-verification channel: .github/workflows/real-api-smoke.yml runs read-path real-API smoke via workflow_dispatch, weekly schedule, or a maintainer-applied real-api PR label (labeling permission is the authorization gate). Smoke coverage grows 3 → 6 cases (adds get_book, get_toc, search). Write paths are never enabled in CI.

Maintainer setup required (cannot be done from the repo)

  • Create a dedicated Yuque test account + minimal-permission token; add it as repo secret YUQUE_MCP_TEST_TOKEN (optionally repo variable YUQUE_REAL_REPO_ID)
  • Create the real-api label
  • Recommended: enable branch protection on main (require PR + green CI) and CODEOWNERS for enforced human review

Test plan

  • npm run check green end-to-end (184 passed, 6 real-api skipped by design)
  • Negative test: injected drift into capability-scope.md (wrong count + renamed tool) — sync test fails with guiding messages; restored and green again
  • New real-api cases follow the existing skip gating (YUQUE_REAL_API=1); shape-verified against formatter output (array for toc/search, id/namespace object for get_book) — real run pending CI secret setup
  • npm run test:coverage and both smoke scripts unaffected

🤖 Generated with Claude Code

chen201724 and others added 4 commits July 2, 2026 22:31
npm run check aggregates lint + format:check + typecheck + test +
build into one definition of done; CI now runs the same command so
local and CI feedback cannot drift. Pin Node via .nvmrc and document
environment bootstrap (npm ci first) in AGENTS.md for agents that
hit 'command not found' on a fresh clone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New capability-scope-docs test extracts the tool list and declared
tool count from docs/capability-scope.md and diffs them against the
live tools/list registry, turning the 'update docs with the tool
surface' convention into an executable invariant. Contract test
assertions now carry failure messages that state what to update when
the change is intentional and what was broken when it is not.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Recipes for the three dominant change types (add a tool, modify a
tool's surface, fix a bug) with exact file-by-file order, the
breaking-change rubric, and pointers to the machine checks that
verify each step. Linked from docs/README.md and AGENTS.md so agents
read the recipe before executing the task.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New workflow runs the real-api smoke suite (read paths only) via
workflow_dispatch, a weekly schedule, or a maintainer-applied
real-api PR label, using a dedicated test-account token from repo
secrets. Smoke suite grows from 3 to 6 cases: get_book, get_toc and
search read paths join user/list_docs/note round-trip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 916e8b4511

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

schedule:
- cron: '0 2 * * 1'
pull_request:
types: [labeled, synchronize]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require re-approval after new PR commits

Because this workflow checks out the PR revision and later passes YUQUE_MCP_TEST_TOKEN into npx vitest, keeping the synchronize trigger means that once a real-api label is applied, every subsequent push to that same PR runs new, unreviewed code with the secret available on same-repository PRs. A contributor can wait for approval, then push a test or script that reads the token; remove synchronize, clear the label on new commits, or gate each SHA through an environment/manual approval before running with secrets.

Useful? React with 👍 / 👎.

chen201724 and others added 2 commits July 4, 2026 12:15
npm run new:tool -- <domain> <yuque_tool_name> creates a
gate-passing tool stub and placeholder test for new domains, prints
a paste-ready snippet for existing domains without touching their
files, rejects duplicate tool names, and always prints the remaining
delivery checklist mirroring docs/workflows/add-tool.md. Turns the
add-tool recipe from a document agents must follow into a procedure
the harness executes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New Tool Request issue template captures a deliverable spec (tool
name, upstream endpoint, access type, parameter table, acceptance
criteria, out-of-scope check) so agents can implement directly from
the issue. Feature Request gains an optional acceptance criteria
field.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat: tool scaffold and structured requirement intake
@chen201724
chen201724 merged commit a8ca978 into feat/harness-improvements Jul 14, 2026
1 check passed
@chen201724
chen201724 deleted the feat/harness-gates branch July 14, 2026 17:23
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