Repository navigation
feat(code-context): helper submits the context file directly (0.2.14) - #36
Merged
Merged
Conversation
A Round in the answer state may carry direct_submission (url, one-time dcs1. token, expires_at). record-round validates and keeps it in the private frozen Round file as directSubmission and never prints the token; a missing url or any invalid offer only disables direct submission. New `submit --candidate <context-local-r<rev>.json>` runs every privacy check, writes context-r<rev>.json, and POSTs it with the submit token and Idempotency-Key direct:round:<round_id>:<payloadDigest> (redirects refused, 120 s timeout). It writes the usual receipt on success, exits 3 when direct submission is unavailable so the agent falls back to MCP, and exits 1 on 401/404/409/422 with sanitized server detail. Rename the local candidate to context-local-r<rev>.json (a legacy submission-r<rev>.json is migrated) and default build-submission --output and record-submission --payload to context-r<rev>.json. The release verifier now allows exactly this one fetch call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 12 of doable-answer-questions now runs `submit` after validate-submission and falls back to build-submission + MCP submit_code_context_round + record-submission only when submit reports direct submission unavailable (exit 3). Update the answer contract commands, test-feature skill, PRIVACY, SECURITY, TESTING, and CHANGELOG for the new file names and the helper's single network call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sion
trd dedupes a Round submission by Idempotency-Key. The direct POST sent
direct:round:<round_id>:<payloadDigest>, so a direct POST that succeeded
but lost its response, followed by the MCP fallback, was not a guaranteed
replay. Send exactly the key doable-mcp computes for
submit_code_context_round: round:<round_id>:<sha256 of Python
json.dumps(payload, sort_keys=True, separators=(",", ":"))>.
pythonJsonDumps reproduces that byte for byte: keys sorted by code point
at every level, compact separators, ensure_ascii escaping of every UTF-16
unit outside 0x20-0x7e as lowercase \uXXXX, integers only. The stableJson
payloadDigest for receipts and the context file envelope is unchanged.
The test posts a payload with Chinese text, an emoji, quotes and a
backslash and checks the key against a digest computed with Python.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Part of Change Set
code-context-direct-submit(getdoable/trd#617,docs/change-sets/code-context-direct-submit.yaml); needs the doable-mcp url PR for the direct path.Problem
After answering, the model re-typed the whole screened payload (up to about 15k tokens) into the MCP call
submit_code_context_round. That took 2 to 5 min per Round, and the model could change content after the privacy screen.Change
record-roundkeeps the Round'sdirect_submissionoffer in the private frozen Round file. It never prints the token. A missing url or an invalid offer degrades to "unavailable" and does not fail the step.submit:context-r<rev>.json.json.dumpssorted and compact, reproduced byte for byte), so an MCP fallback is an idempotent replay.build-submission+ MCP submit +record-submission); 1 on 401, 404, 409 or 422, with a clear next step.context-local-r<rev>.json(a legacysubmission-r<rev>.jsonis migrated);context-r<rev>.json.submit; references, README, SECURITY, PRIVACY, TESTING and CHANGELOG are updated. Version 0.2.14 (main is at 0.2.13).Policy change (needs owner sign-off)
The helper used to make no network calls. It now makes exactly one POST:
verify-release.mjsenforces that shape: onefetch(,redirect: "error",X-Doable-Submit-Token, and still blocksAuthorization,DOABLE_API_KEY, raw sockets and other HTTP clients.Tests
npm test: release verifierVerified doable-code-context@0.2.14, workflow check passes, node tests 6/6.Direct submission: available, ransubmitand gotRound submitted;🤖 Generated with Claude Code