approval-loop-contract-details: Approval loop contract details #2

Open
std-bot wants to merge 1 commit from task/approval-loop-contract-details into main
First-time contributor

Assigned idea

Benchmark authoring specification.

Summary: Add a precise approval.request routing subsection to the desktop backend contract so the Gateway approval loop is documented beyond the current event-table entry.

Task intent: Update docs/desktop-prd/04-backend-contract.md to clarify how desktop clients should route Gateway approval.request events with type values such as clarify, sudo, secret, and unknown future values to the corresponding RPC response methods while preserving the documented transport-layer rule.

Benchmark plan: Construct a regular documentation-change package against commit bedb13b2c01b035fd6d29ae8831abd7fc6cb2cfd. The solver prompt should ask for one focused edit to docs/desktop-prd/04-backend-contract.md: add a subsection titled “### 审批回路类型路由” near the Gateway JSON-RPC/SSE contract area, with a Markdown table mapping clarify→clarify.respond, sudo→sudo.respond, secret→secret.respond, and other/unknown→approval.respond, plus a sentence that desktop code must keep this flow behind web/src/lib/transport.ts rather than opening EventSource or REST calls directly.

Environment plan: Task environment: no live Hermes backend, OAuth, SSE server, or desktop runtime is required; this is a repository documentation update verified by file inspection. Environment/repo: use the materialized Hermes-CN-Desktop repository at the fixed commit and run the Python verifier from the task package root after the solver changes the working tree.

Verifier plan: test_outputs.py should read docs/desktop-prd/04-backend-contract.md and fail unless it contains the exact heading “### 审批回路类型路由”, a Markdown table row for each required mapping containing both the approval.request type token and the response RPC token, and a transport-only sentence mentioning web/src/lib/transport.ts together with not bypassing direct EventSource/REST access. It should also fail if files outside docs/desktop-prd/04-backend-contract.md are modified.

Oracle plan: The oracle solution is a minimal Markdown patch to docs/desktop-prd/04-backend-contract.md adding the required subsection and four-row routing table. The verifier should compare semantic requirements rather than full-file text so harmless Chinese wording variations pass if the heading, mappings, and transport restriction are present.

Difficulty plan: Current coding assistants may over-implement source changes in transport/hooks instead of completing the contract document, or they may notice existing approval.request and response method mentions and assume no new detail is needed. The verifier therefore requires a new heading, explicit type-to-RPC routing rows, and edit-scope discipline.

Repo patch scope: Expected upstream edit is docs/desktop-prd/04-backend-contract.md only; no source files, package metadata, generated assets, or broad documentation directories should be changed.

Anti-leakage notes: Do not expose solver-facing references to benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context; the visible prompt should read like a normal documentation improvement request.

Approach: Place the new subsection close to the Gateway approval loop discussion. Use the existing terms approval.request, clarify.respond, sudo.respond, secret.respond, approval.respond, and web/src/lib/transport.ts so the addition aligns with the documented backend contract.

Verification: Run python test_outputs.py from the task package root; it must inspect docs/desktop-prd/04-backend-contract.md and the git diff to confirm the required approval routing documentation and single-file edit scope.

Risk: Main risk is a superficial doc fragment that repeats existing event names without adding routing semantics. Mitigate by checking the exact heading, one row per required type category, response method names, and the transport-layer restriction.

Path rules: task package is tasks/; mutable upstream checkout is tasks//environment/repo; benchmark package files are under tasks//task; verifier/container environment belongs under tasks//task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest.

Agent context

Task slug: approval-loop-contract-details
Branch: task/approval-loop-contract-details

## Assigned idea Benchmark authoring specification. Summary: Add a precise approval.request routing subsection to the desktop backend contract so the Gateway approval loop is documented beyond the current event-table entry. Task intent: Update docs/desktop-prd/04-backend-contract.md to clarify how desktop clients should route Gateway approval.request events with type values such as clarify, sudo, secret, and unknown future values to the corresponding RPC response methods while preserving the documented transport-layer rule. Benchmark plan: Construct a regular documentation-change package against commit bedb13b2c01b035fd6d29ae8831abd7fc6cb2cfd. The solver prompt should ask for one focused edit to docs/desktop-prd/04-backend-contract.md: add a subsection titled “### 审批回路类型路由” near the Gateway JSON-RPC/SSE contract area, with a Markdown table mapping clarify→clarify.respond, sudo→sudo.respond, secret→secret.respond, and other/unknown→approval.respond, plus a sentence that desktop code must keep this flow behind web/src/lib/transport.ts rather than opening EventSource or REST calls directly. Environment plan: Task environment: no live Hermes backend, OAuth, SSE server, or desktop runtime is required; this is a repository documentation update verified by file inspection. Environment/repo: use the materialized Hermes-CN-Desktop repository at the fixed commit and run the Python verifier from the task package root after the solver changes the working tree. Verifier plan: test_outputs.py should read docs/desktop-prd/04-backend-contract.md and fail unless it contains the exact heading “### 审批回路类型路由”, a Markdown table row for each required mapping containing both the approval.request type token and the response RPC token, and a transport-only sentence mentioning web/src/lib/transport.ts together with not bypassing direct EventSource/REST access. It should also fail if files outside docs/desktop-prd/04-backend-contract.md are modified. Oracle plan: The oracle solution is a minimal Markdown patch to docs/desktop-prd/04-backend-contract.md adding the required subsection and four-row routing table. The verifier should compare semantic requirements rather than full-file text so harmless Chinese wording variations pass if the heading, mappings, and transport restriction are present. Difficulty plan: Current coding assistants may over-implement source changes in transport/hooks instead of completing the contract document, or they may notice existing approval.request and response method mentions and assume no new detail is needed. The verifier therefore requires a new heading, explicit type-to-RPC routing rows, and edit-scope discipline. Repo patch scope: Expected upstream edit is docs/desktop-prd/04-backend-contract.md only; no source files, package metadata, generated assets, or broad documentation directories should be changed. Anti-leakage notes: Do not expose solver-facing references to benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context; the visible prompt should read like a normal documentation improvement request. Approach: Place the new subsection close to the Gateway approval loop discussion. Use the existing terms approval.request, clarify.respond, sudo.respond, secret.respond, approval.respond, and web/src/lib/transport.ts so the addition aligns with the documented backend contract. Verification: Run python test_outputs.py from the task package root; it must inspect docs/desktop-prd/04-backend-contract.md and the git diff to confirm the required approval routing documentation and single-file edit scope. Risk: Main risk is a superficial doc fragment that repeats existing event names without adding routing semantics. Mitigate by checking the exact heading, one row per required type category, response method names, and the transport-layer restriction. Path rules: task package is tasks/<slug>; mutable upstream checkout is tasks/<slug>/environment/repo; benchmark package files are under tasks/<slug>/task; verifier/container environment belongs under tasks/<slug>/task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest. ## Agent context Task slug: approval-loop-contract-details Branch: task/approval-loop-contract-details <!-- std-ts:idea-pr-body -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task/approval-loop-contract-details:task/approval-loop-contract-details
git switch task/approval-loop-contract-details

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff task/approval-loop-contract-details
git switch task/approval-loop-contract-details
git rebase main
git switch main
git merge --ff-only task/approval-loop-contract-details
git switch task/approval-loop-contract-details
git rebase main
git switch main
git merge --no-ff task/approval-loop-contract-details
git switch main
git merge --squash task/approval-loop-contract-details
git switch main
git merge --ff-only task/approval-loop-contract-details
git switch main
git merge task/approval-loop-contract-details
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snorkel/root-repository-maintenance-e1fa0b0580dd4c!2
No description provided.