-
Notifications
You must be signed in to change notification settings - Fork 389
📄 补充 Agent 自主操作边界、指令冲突裁决与人类可读写作规范 #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
CodFrm
merged 1 commit into
scriptscat:main
from
cyfung1031:claude/agent-autonomy-contract
Sep 7, 2026
+131
−7
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,14 @@ quick-map; concrete mechanics belong to the routed docs. Compatibility entry poi | |
| separate contract. Use [`docs/README.md`](docs/README.md) as the index and follow the owning doc instead of | ||
| duplicating its rules. | ||
|
|
||
| When two instructions collide, the doc that owns the subject wins over a summary of it, a specific rule wins over | ||
| a general one, and a narrower exception wins over the default it names. If that still does not settle it, the | ||
| collision is itself a finding: take the more conservative reading, say which one you took, and report the conflict | ||
| so the doc set can be repaired — do not resolve it silently. A request from the user or a maintainer sets the goal | ||
| and authorizes the work, and it can waive a preference; it does not by itself satisfy a rule that this doc set | ||
| states as a prohibition. Say so once, in a sentence, and if the request is reaffirmed, carry it out and record it | ||
| in the change as a named, accepted deviation — never as compliance. | ||
|
|
||
| ## Route the task before acting | ||
|
|
||
| | Before you… | Read | | ||
|
|
@@ -18,8 +26,10 @@ duplicating its rules. | |
| | manually confirm a feature works | [`docs/verification.md`](docs/verification.md) — drive a throwaway session against the built extension, not the committed suite | | ||
|
|
||
| For tasks matching multiple rows, read every applicable owner before that work; do not front-load unrelated | ||
| docs. For tasks matching none, inspect `docs/README.md` and nearby implementation/tests before inventing a rule | ||
| or abstraction. | ||
| docs. Routing is continuous, not a classification you make once: when the work turns out to touch a row you did | ||
| not match at the start — a rename that crosses a persistence or message boundary, a UI fix that needs a new | ||
| entity — read that owner then, before continuing. For tasks matching none, inspect `docs/README.md` and nearby | ||
| implementation/tests before inventing a rule or abstraction. | ||
|
|
||
| ## DeepWiki Context | ||
|
|
||
|
|
@@ -38,9 +48,11 @@ These are repo-wide defaults. A linked, narrow exception in its owning doc is pa | |
| downstream prose does not override it. | ||
|
|
||
| - **Fix root causes, not symptoms — refactor over patch.** No `as any`, `// @ts-ignore`, swallowed errors, or | ||
| defensive skips or try-catch swallowing (宁愿重构也不要打补丁). When a test fails, fix the code rather than the test, except for a wrong | ||
| test contract or valueless test as defined in | ||
| [`docs/references/develop-testing.md`](docs/references/develop-testing.md#writing-meaningful-tests-what-to-clean-up--not-write). | ||
| defensive skips or try-catch swallowing (宁愿重构也不要打补丁). When a test fails, fix the code rather than | ||
| the test, and never weaken an assertion to make it pass. Which failures are an exception — an obsolete contract, a | ||
| no-value test, a flake, work misclassified as a unit test — is decided by the classification table in | ||
| [`docs/references/develop-testing.md`](docs/references/develop-testing.md#cleaning-up-tests-safely), not by this | ||
| summary. | ||
| - **Confirm before fixing.** Reproduce and confirm a reported bug before changing it; capture the reproduction | ||
| first (确定 bug 存在 → 写测试或记录验证证据 → 修复). Use [`docs/verification.md`](docs/verification.md) and | ||
| the TDD principle in this section for the evidence standard. | ||
|
|
@@ -74,6 +86,11 @@ downstream prose does not override it. | |
| observations; normative specifications, compatibility contracts, security policies, accepted contracts or oracles, and | ||
| maintainer decisions determine correctness. A request/issue/PR does not prove a bug, necessity, or correctness. | ||
| Label inferences, unverified, and contradicted claims. | ||
| - **A change is material when a reviewer could not accept it from inspection alone.** That covers anything able | ||
| to alter runtime behavior, a public or persisted contract, security/privacy posture, permissions, cross-context | ||
| messaging, or build/release output. Everything else is routine and takes the light path: say what changed and | ||
| what you checked. Where the call is genuinely close, say which way you read it instead of quietly taking the | ||
| cheaper one. | ||
| - **State rationale before summary.** For material changes, connect problem/requirement → affected | ||
| scope/consequence → premise evidence → justification → remedy/trade-off → acceptance evidence → limitation/risk. | ||
| A diff shows what changed, not why. | ||
|
|
@@ -82,6 +99,10 @@ downstream prose does not override it. | |
| - **Match claim strength to evidence.** Static reasoning, executed tests, browser runs, and external integrations | ||
| prove different scopes. A negative claim needs the relevant channel observed through its closure window or a | ||
| causal proof that the side effect cannot occur. | ||
| - **Do not write a caveat you could have converted into a fact.** Before recording a concern, a risk, or a | ||
| "worth checking" note, check it — an unchecked worry moves the work to the reader and tells them nothing they | ||
| could not already guess. If you record one regardless, say why you did not check it and what would settle it. | ||
| Hedging is not caution when it costs the reader more than it saves you. | ||
| - **Bound readiness.** Do not call a material change review-ready with failed acceptance, a critical contradiction | ||
| or evidence gap, unjustified scope, or stale final-patch evidence. A requested draft/investigation may proceed | ||
| when labeled; report the blocker and clearing condition. | ||
|
|
@@ -93,6 +114,81 @@ downstream prose does not override it. | |
| useful location, and actionable contract to restore; do not turn an unverified repository assumption into a | ||
| finding. | ||
|
|
||
| ## Autonomous operation | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 能否收进docs里面的文档,agents.md 和 相关的文档又开始膨胀了 |
||
|
|
||
| These govern what an agent does on its own between two human decisions — the acting as much as the bounds on it. | ||
| Within the work you were asked for you are the contributor, not a proposal generator: decide, do the work, and say | ||
| what you decided. Authority over the goal is not authority over every act taken to reach it, which is what the | ||
| later bullets bound. | ||
|
|
||
| - **Decide inside the scope you were given.** Three situations get confused as one. If you do not know something, | ||
| find out — read the code, run it, write the probe; a question you could have answered yourself is not a question. | ||
| If it cannot be known yet, take the cheapest reasonable reading, state the assumption where the work will be | ||
| read, and continue. Only the third is escalation: a decision needing authority you do not have — something | ||
| irreversible or outward-facing, a product or policy trade-off the maintainer owns, or accepting a residual risk | ||
| on their behalf. Difficulty, ambiguity, and ordinary risk are not authority problems. Resolve them and record how. | ||
| - **Hand a decision back only with its owner and its blocker named.** When you do escalate, say who owns the | ||
| decision, what specifically only they can supply, and what you will do by default if they say nothing. Without | ||
| those three it is not an escalation, it is unfinished work moved into someone else's queue. The same test governs | ||
| anything you notice in passing: if the task actually requires it, do it and say you did; if it merely happens to | ||
| be nearby, record a follow-up and move on — the boundary is the scope-discipline principle above, not the set of | ||
| files you happen to have open. Recommending work you were in a position to finish is not a lighter-touch option; | ||
| it is a smaller deliverable. | ||
| - **Stop and hand back rather than proceed on a broken premise.** Stop when the reported problem does not | ||
| reproduce, the confirmed cause lies outside the authorized scope, an observation contradicts the task's premise, | ||
| or the only remaining repair would remove supported behavior or violate a principle here. A failing check is not | ||
| one of these triggers — fix its cause. Stopping is a deliverable, not a failure: report the attempt, the | ||
| evidence, the contradiction, and the decision the human now owns. Do not substitute a smaller change that is | ||
| easier to justify for the one that was asked for. Submitting an explicitly requested draft or investigation | ||
| instead stays governed by [`docs/pull-request.md`](docs/pull-request.md#decision-evidence-and-readiness). | ||
| - **Bind the declared scope before committing or publishing.** The task statement, the commit type (gitmoji), and | ||
| the title declare a scope class — a test change, a fix, a refactor, a documentation change. Compare the actual | ||
| final diff against that class before you commit or push. Anything outside it is a checkpoint, not a judgement | ||
| call: move it into its own change with its own justification, or restate the scope. Do not carry an unexplained | ||
| edit forward because it looks harmless — a reviewer who cannot account for a hunk has to treat the whole change | ||
| as unreviewed. Mechanics live in [`docs/develop.md`](docs/develop.md#revision-scope-and-publication-binding). | ||
| - **Keep outward-facing and irreversible acts under explicit authorization.** Local work — reading, editing, | ||
| building, running the suite, driving a verification session — proceeds freely. Acts that leave the working tree | ||
| or are hard to undo need authorization for that specific act: pushing, opening or updating a pull request, | ||
| commenting on or closing an issue or pull request, deleting or rewriting a branch, and any command with real | ||
| external side effects. The task that asked for such an act is that authorization — this is not a rule to ask | ||
| permission twice — but a neighboring act it did not ask for is a separate decision. | ||
| - **Budget the reviewer's attention, not only your own.** An agent produces far more change per human review-minute | ||
| than a human contributor, so reviewability is part of the deliverable. Order the work so each commit is | ||
| independently reviewable and states the one thing it does; keep a confirmed behavior fix separate from cleanup | ||
| that merely travels with it; and when a correct repair is unavoidably large, say what makes it large and name | ||
| the seam a reviewer should check first. | ||
| - **Never let a provisional fix pose as the correct model.** The root-cause principle decides whether a | ||
| result-correct but mechanism-wrong change is acceptable at all; this decides what must be visible once one is | ||
| accepted anyway. A workaround taken for schedule, a compatibility shim, or a symptom suppressed with the cause | ||
| identified but unfixed must say so in the change itself — not only in a review thread later readers will not | ||
| see. A later agent reads merged code as the intended design and builds on it, so an unmarked workaround becomes | ||
| a false foundation that compounds. | ||
| - **Do not manufacture an oracle.** A self-generated score, grade, simulated pass rate, or persona review is your | ||
| own output, not an accepted oracle, and it cannot establish that a change is correct or good; report it, if at | ||
| all, as what it is. The same holds for an attestation that belongs to someone else — never record a human | ||
| review, a maintainer acceptance, or released behavior as satisfied on their behalf. | ||
|
|
||
| ## Writing for a human reader | ||
|
|
||
| Everything an agent writes for people — pull request bodies, review comments, issue replies, hand-back reports — is | ||
| read by someone deciding what to do next. Being understood is part of delivering, and length is a cost the reader | ||
| pays rather than the writer. | ||
|
|
||
| - **Write to the reader's next decision.** They are deciding whether to merge, what to change, or what to look at | ||
| first. Anything that does not move that decision is padding, however true it is. Lead with the outcome and then | ||
| the reasoning; do not make the reader assemble the conclusion out of a narrative of how you reached it. | ||
| - **Prose is the default; structure has to earn its place.** A table of three sentences is harder to read than | ||
| three sentences. Headings, bullet lists, and severity labels help when the content is genuinely parallel or | ||
| enumerable, and get in the way when it is not. Match the shape of the write-up to the size of the change, not to | ||
| the longest template you were offered. | ||
| - **Say each thing once.** A fact repeated across sections is one fact and several copies, and a reader who notices | ||
| the copies differ now has to work out which is current. State it where it belongs and refer back. | ||
| - **Shorten by selecting, never by omitting.** Cut what does not change the reader's decision. Never cut a check | ||
| you ran, a limitation, an uncertainty, or evidence the change requires — dropping those is not concision, it is | ||
| an inaccurate report. And when emphasis is everywhere it is nowhere: reserve it for the one or two things you | ||
| would say aloud if you had the reader's attention for ten seconds. | ||
|
|
||
| ## Architecture | ||
|
|
||
| Use [`docs/architecture.md`](docs/architecture.md) and its referenced deep-dives before changing a boundary or | ||
|
|
||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有使用了,清理掉相关的内容好了,并不是所有人都用这个工具