@attalabs/vinaya 0.42.1 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checks/bin/check-evidence-fresh.js +177 -152
- package/dist/checks/bin/check-registry-gates.js +10 -3
- package/dist/index.js +300 -173
- package/dist/lib/pre-push-cache-test-run.js +145 -144
- package/dist/lib/pre-push-changed-files.js +10 -3
- package/dist/lib/pre-push-progress-dir.js +169 -147
- package/dist/lib/pre-push-select-tests.js +16 -4
- package/dist/lib/push-progress-observer.js +169 -147
- package/dist/programs/archive.js +172 -148
- package/dist/programs/audit.js +169 -147
- package/dist/programs/check.js +172 -148
- package/dist/programs/commit-msg.js +172 -148
- package/dist/programs/dev-review-loop.js +300 -176
- package/dist/programs/dispatch.js +1905 -1877
- package/dist/programs/log-emit.js +172 -148
- package/dist/programs/log-selftest.js +172 -148
- package/dist/programs/log-send.js +172 -148
- package/dist/programs/pr-report.js +177 -152
- package/dist/programs/pr-snapshot.js +172 -148
- package/dist/programs/pr-verify-evidence.js +177 -152
- package/dist/programs/pr.js +172 -148
- package/dist/programs/review-post.js +172 -148
- package/dist/programs/review-status.js +180 -148
- package/dist/programs/run-engine.js +110594 -0
- package/dist/programs/supervised-command.js +67 -0
- package/dist/programs/sync.js +63 -39
- package/dist/programs/task-brief.js +174 -150
- package/dist/programs/task-sweep.js +244 -151
- package/dist/programs/task-tools-serve.js +260 -163
- package/dist/programs/tokens.js +172 -148
- package/dist/programs/waiver.js +172 -148
- package/dist/vinaya-strict/checks/registry.ts +1085 -0
- package/dist/vinaya-strict/executing/code-reviewer/README.md +3 -0
- package/dist/vinaya-strict/executing/code-reviewer/doctrine.md +185 -0
- package/dist/vinaya-strict/executing/code-reviewer/evals/README.md +1 -0
- package/dist/vinaya-strict/executing/code-reviewer/evals/code-reviewer-cases.json +280 -0
- package/dist/vinaya-strict/executing/code-reviewer/grants.yaml +22 -0
- package/dist/vinaya-strict/executing/code-reviewer/output.schema.json +93 -0
- package/dist/vinaya-strict/executing/code-reviewer/review-result.ts +347 -0
- package/dist/vinaya-strict/executing/dev-review.flow.yaml +103 -0
- package/dist/vinaya-strict/executing/developer/README.md +3 -0
- package/dist/vinaya-strict/executing/developer/developer-doctrine-shape.test.ts +69 -0
- package/dist/vinaya-strict/executing/developer/developer-turn-result.ts +286 -0
- package/dist/vinaya-strict/executing/developer/doctrine.md +111 -0
- package/dist/vinaya-strict/executing/developer/evals/README.md +1 -0
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-cases.json +6275 -0
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-held-out.json +11526 -0
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.test.ts +498 -0
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.ts +1407 -0
- package/dist/vinaya-strict/executing/developer/grants.yaml +25 -0
- package/dist/vinaya-strict/executing/developer/output.schema.json +148 -0
- package/dist/vinaya-strict/executing/developer/reference.md +376 -0
- package/dist/vinaya-strict/executing/operator/doctrine.md +209 -0
- package/dist/vinaya-strict/executing/security-reviewer/README.md +3 -0
- package/dist/vinaya-strict/executing/security-reviewer/doctrine.md +171 -0
- package/dist/vinaya-strict/executing/security-reviewer/evals/README.md +1 -0
- package/dist/vinaya-strict/executing/security-reviewer/evals/security-reviewer-cases.json +141 -0
- package/dist/vinaya-strict/executing/security-reviewer/grants.yaml +22 -0
- package/dist/vinaya-strict/executing/security-reviewer/output.schema.json +93 -0
- package/dist/vinaya-strict/integration/config/vinaya-config-section.ts +1278 -0
- package/dist/vinaya-strict/integration/policies/vinaya-policies.ts +52 -0
- package/dist/vinaya-strict/integration/process/process-integration.ts +57 -0
- package/dist/vinaya-strict/loops/dev-review/v2/dev-review-v2.flow.yaml +136 -0
- package/dist/vinaya-strict/process.yaml +43 -0
- package/dist/vinaya-strict/retrospecting/archivist/doctrine.md +174 -0
- package/dist/vinaya-strict/retrospecting/tranche-archivist/doctrine.md +270 -0
- package/dist/vinaya-strict/thinking/architect/doctrine.md +110 -0
- package/dist/vinaya-strict/thinking/planner/doctrine.md +105 -0
- package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.test.ts +128 -0
- package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.ts +169 -0
- package/dist/vinaya-strict/thinking/planner/tools/open-issue.test.ts +701 -0
- package/dist/vinaya-strict/thinking/planner/tools/open-issue.ts +1035 -0
- package/dist/vinaya-strict/thinking/planner/tools/planner-operations.test.ts +359 -0
- package/dist/vinaya-strict/thinking/planner/tools/planner-operations.ts +815 -0
- package/dist/vinaya-strict/thinking/planner/tools/planner-tools.test.ts +200 -0
- package/dist/vinaya-strict/thinking/planner/tools/planner-tools.ts +458 -0
- package/package.json +4 -2
- package/studio-standalone/apps/vinaya-studio/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/build-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/middleware-build-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/pages/500.html +1 -1
- /package/studio-standalone/apps/vinaya-studio/.next/static/{yFfoujElgbwPk-7KNS-kw → x2q88XfwsihlevulRhIvs}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/.next/static/{yFfoujElgbwPk-7KNS-kw → x2q88XfwsihlevulRhIvs}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
role: developer
|
|
2
|
+
# The role's capability contract. It names what the role may do, never a vendor's tools: each agent
|
|
3
|
+
# adapter maps it to its own built-ins (harness/kernel/adapters/agents/README.md), and denies every built-in
|
|
4
|
+
# no allowed capability names.
|
|
5
|
+
# Per vendor only because a model id names one vendor's model; process-supplied leaves it to the run.
|
|
6
|
+
models: { claude: process-supplied, codex: process-supplied }
|
|
7
|
+
capabilities:
|
|
8
|
+
read_files: allow
|
|
9
|
+
# Command rules are plain command prefixes: "git push" refuses `git push …`; a trailing * also matches a
|
|
10
|
+
# longer first word ("sudo*" refuses `sudoedit`). Each adapter renders them in its own rule syntax.
|
|
11
|
+
run_commands:
|
|
12
|
+
default: allow
|
|
13
|
+
allow: ["git worktree add", "git worktree list", "git fetch", "git pull", "git status", "git diff", "git log", "git show", "git add", "git commit", "git config", "git branch", "git checkout", "git merge", "git rebase", "bun install", "bun run", "bun test", "bun harness/processes/vinaya-strict/checks/standalone/verify-dispatch.ts", "bun harness/processes/vinaya-strict/checks/standalone/verify-docs.ts", "bun harness/processes/vinaya-strict/checks/standalone/verify-task.ts", "bun apps/cli/src/index.ts", "bun harness/processes/vinaya-strict/checks/check.ts", "bun harness/processes/vinaya-strict/tools/pr-report/bin/pr-report.ts", "bun harness/processes/vinaya-strict/loops/dev-review/bin/review-status.ts", "bun harness/processes/vinaya-strict/tools/pr-report/tokens/bin/tokens.ts", "npx --yes -p @attalabs/vinaya@"]
|
|
14
|
+
deny: ["git push", "gh", "git commit --no-verify*", "git commit -n*", "git stash*", "git reset --hard*", "rm -rf*", "sudo*", "security", "launchctl", "defaults", "systemsetup", "networksetup", "pmset", "dscl", "crontab", "chsh", "git config --global", "git config --system", "sudo"]
|
|
15
|
+
write_files: ["${WORKTREE}", "${SCRATCH}", "${BUN_INSTALL_CACHE}", "${GIT_COMMON_DIR}", "${GIT_DIR}"]
|
|
16
|
+
network: [github.com, api.github.com, raw.githubusercontent.com, codeload.github.com, objects.githubusercontent.com, registry.npmjs.org, api.anthropic.com]
|
|
17
|
+
web_fetch: allow
|
|
18
|
+
web_search: deny
|
|
19
|
+
subagents: allow
|
|
20
|
+
plan_tool: allow
|
|
21
|
+
view_image: allow
|
|
22
|
+
mcp_tools:
|
|
23
|
+
vinaya_dev_tools: [fetch_documentation, run_checks, repair_plan, publish_changes, open_pull_request, update_pull_request_body, refresh_evidence, read_pull_request]
|
|
24
|
+
hooks: { background_shell: true, force_push: true, no_verify: true, default_branch_commit: true, write_scope: true }
|
|
25
|
+
sandbox: enabled
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"turnResult": {
|
|
5
|
+
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "type": "number", "const": 1 },
|
|
10
|
+
"status": { "type": "string", "const": "completed" },
|
|
11
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
12
|
+
"confidence": { "type": "integer", "minimum": 0, "maximum": 100 },
|
|
13
|
+
"confidenceExplanation": { "type": "string", "minLength": 1, "maxLength": 280 },
|
|
14
|
+
"addressedFindingIds": { "maxItems": 0, "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
15
|
+
"sourceUses": {
|
|
16
|
+
"minItems": 0,
|
|
17
|
+
"maxItems": 0,
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"properties": {
|
|
22
|
+
"source": { "type": "string", "minLength": 1 },
|
|
23
|
+
"use": { "type": "string", "minLength": 1 }
|
|
24
|
+
},
|
|
25
|
+
"required": ["source", "use"],
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"reportedChecks": {
|
|
30
|
+
"anyOf": [
|
|
31
|
+
{
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"command": { "type": "string", "minLength": 1 },
|
|
37
|
+
"outcome": { "type": "string", "enum": ["pass", "fail"] }
|
|
38
|
+
},
|
|
39
|
+
"required": ["command", "outcome"],
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{ "type": "null" }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"schemaVersion",
|
|
49
|
+
"status",
|
|
50
|
+
"summary",
|
|
51
|
+
"confidence",
|
|
52
|
+
"confidenceExplanation",
|
|
53
|
+
"addressedFindingIds",
|
|
54
|
+
"sourceUses",
|
|
55
|
+
"reportedChecks"
|
|
56
|
+
],
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"schemaVersion": { "type": "number", "const": 1 },
|
|
63
|
+
"status": { "type": "string", "const": "blocked" },
|
|
64
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
65
|
+
"blocker": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"properties": {
|
|
68
|
+
"kind": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": [
|
|
71
|
+
"dependency_unmerged",
|
|
72
|
+
"conflict_open",
|
|
73
|
+
"preflight_failed",
|
|
74
|
+
"premise_stale",
|
|
75
|
+
"brief_contradicts_code",
|
|
76
|
+
"test_failure",
|
|
77
|
+
"destructive_unauthorized",
|
|
78
|
+
"tooling_unavailable"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"detail": { "type": "string", "minLength": 1 }
|
|
82
|
+
},
|
|
83
|
+
"required": ["kind", "detail"],
|
|
84
|
+
"additionalProperties": false
|
|
85
|
+
},
|
|
86
|
+
"sourceUses": {
|
|
87
|
+
"anyOf": [
|
|
88
|
+
{
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"source": { "type": "string", "minLength": 1 },
|
|
94
|
+
"use": { "type": "string", "minLength": 1 }
|
|
95
|
+
},
|
|
96
|
+
"required": ["source", "use"],
|
|
97
|
+
"additionalProperties": false
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{ "type": "null" }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": ["schemaVersion", "status", "summary", "blocker", "sourceUses"],
|
|
105
|
+
"additionalProperties": false
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"schemaVersion": { "type": "number", "const": 1 },
|
|
111
|
+
"status": { "type": "string", "const": "needs_ruling" },
|
|
112
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
113
|
+
"rulingRequest": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"properties": {
|
|
116
|
+
"question": { "type": "string", "minLength": 1 },
|
|
117
|
+
"decisions": { "type": "array", "items": { "type": "string", "minLength": 1 } }
|
|
118
|
+
},
|
|
119
|
+
"required": ["question", "decisions"],
|
|
120
|
+
"additionalProperties": false
|
|
121
|
+
},
|
|
122
|
+
"sourceUses": {
|
|
123
|
+
"anyOf": [
|
|
124
|
+
{
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"source": { "type": "string", "minLength": 1 },
|
|
130
|
+
"use": { "type": "string", "minLength": 1 }
|
|
131
|
+
},
|
|
132
|
+
"required": ["source", "use"],
|
|
133
|
+
"additionalProperties": false
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{ "type": "null" }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"required": ["schemaVersion", "status", "summary", "rulingRequest", "sourceUses"],
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"required": ["turnResult"],
|
|
147
|
+
"additionalProperties": false
|
|
148
|
+
}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
# Developer — Reference
|
|
2
|
+
|
|
3
|
+
The Developer's full procedure — moved out of the seat file (`roles/developer.md`) to keep that file to its short version and entry gate. Linked once, from there; read it before opening a PR, addressing a review round, or claiming a task done.
|
|
4
|
+
|
|
5
|
+
Two paths run through it. **Under the review loop** the driver dispatches you, and its tools and gates carry most of the mechanics; where one of them already holds a rule, this page names the tool or gate instead of restating the rule. **Working manually, with no driver**, nothing holds those rules for you, and the manual-path paragraphs say what you do yourself.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What the Developer owns
|
|
10
|
+
|
|
11
|
+
**Technical execution.** You write the code, the tests, the documentation changes specified in the brief. Everything in the brief's stated scope is yours to execute.
|
|
12
|
+
|
|
13
|
+
**Tests.** Every behavioral change ships with tests. Tests prove behavior, not that code compiles. A test that mocks the thing being tested is not a test.
|
|
14
|
+
|
|
15
|
+
**Passing the hooks.** A hook's rejection names a defect in the change; the fix is to the change.
|
|
16
|
+
|
|
17
|
+
**Worktree discipline.** Your brief's Step 0 enters your worktree and installs; it never creates it. Under the review loop the driver created it, outside any sandbox, before your first turn; working manually, you create it yourself first — see [§ Worktree discipline](#worktree-discipline).
|
|
18
|
+
|
|
19
|
+
**Who commits and publishes — the driver-run tools when dispatched, yourself when manual.** Under the review loop, Claude and Codex alike, the sandbox and the session's permission policy deny you every forge command and every `git push`; you publish through tools the driver runs in its own process, outside your sandbox, for the length of your turn. `publish_changes` commits the worktree under your one-line `Type(scope): Description` header and pushes the task branch — it is the only commit maker: it validates the header and refuses a turn whose head moved or a branch or base that is not the task's; a changed path outside the Surface is published, named back in its result, and recorded by the driver in the pull request body's beyond-Surface block, where the reviewers judge it; and the push runs the protected-path and pre-push hooks. `open_pull_request` opens the PR with a title and body when none is open, behind the PR-body validator; `update_pull_request_body` and `refresh_evidence` change a body already open; `read_pull_request` returns the PR's state, checks (with each failed check's log tail), reviews and body; `run_checks` runs `vinaya-check --all` at the current head. Each returns a structured success or a structured refusal naming the failing check and its fix; a refusal is a failed tool call you read and act on in the same turn. Publish after each numbered Part of the brief, and open the pull request once the first Part is published.
|
|
20
|
+
|
|
21
|
+
**Working manually, with no driver,** you hold your own forge credential and commit, push and open (or update) your own pull request; your turn is not done until the commit is made, the branch is pushed and the pull request is open. Commit after each numbered Part — one logical change per commit, so the history reads as a narrative of the approach — and push once, immediately before opening the PR. The pre-push hook runs the affected tests (`bun harness/processes/vinaya-strict/integration/pre-push-select-tests.ts | xargs -r bun test --timeout=30000 --`, never the full suite) on that push and refuses it on failure, so there is no separate per-Part run. The push, and the call that opens or updates the pull request, are foreground steps: run each to completion, and end the turn only once `gh pr view` on the branch shows the pull request. A turn that ends with commits made but never published is incomplete (found live: a backgrounded push that died with the session left only local commits, while the loop polled for a pull request no process would open). A branch that conflicts with its base is resolved before the push.
|
|
22
|
+
|
|
23
|
+
**What the affected suite covers.** It covers only the packages `turbo`'s own dependency graph marks affected by the diff — a rule about one package's files that lives in another package's test never runs on a push that only touches the first package (found live: a CLI-only diff never marked the process package affected, so a rule about CLI files, asserted only in a process-package test, never ran at the push hook at all). A rule meant to bind a package's own files belongs in a `vinaya-check`, not in a sibling package's test suite.
|
|
24
|
+
|
|
25
|
+
**A verdict binds to the head it judged.** A push landing after the newest verdict's judged head voids it: `vinaya-review-status` prints `push after verdict — re-review required`, and merge waits on a fresh review round.
|
|
26
|
+
|
|
27
|
+
**Your turn's token use is the log's record, not the body's.** A dispatched turn's usage is collected from the agent host by the dispatch path and written to the Vinaya log as its own `usage` event, per attempt, with no step of yours in between — there is nothing to paste at turn-end and no "Token report" section to carry. `vinaya-tokens` still prints a role's `Tokens: …` line for a human who wants the figure in hand, and a reviewing role still reports its own figures on its verdict comment (`tranche-model.md` §12).
|
|
28
|
+
|
|
29
|
+
**Opening the PR with a complete description.** The PR description (1) carries the report — the brief already lives on the task Issue, posted frozen as its `vinaya:brief:v1` comment by `vinaya-task-brief` before your worktree existed, and the Reviewer and Archivist read it there; (2) follows the canonical form in [§ PR body — canonical form](#pr-body--canonical-form) below, the verbatim template including the exact `Tier:` field syntax; (3) references the task's Issue (`Closes #N`) so the merge auto-closes it. Opening the PR is itself the `in-flight → in-review` transition; you write no status field. After open, a body change goes through `update_pull_request_body` (or `refresh_evidence` for the Evidence block) under the review loop, or a body edit working manually; the Principal's `[principal]` ticks are the Principal's writes and survive every edit. A review round's response is not a body section — see [§ Review handoff](#review-handoff).
|
|
30
|
+
|
|
31
|
+
**Re-pin a premise you legitimately change.** A brief's premise records the state at dispatch, not a requirement to preserve that state. When the task removes or renames text a premise pins, update the PR body's anchored `Premise` block in the same publication to a true post-change pin: `absent` for removed text, or the replacement text. Record what changed and why under `## Decisions`. `premise-recheck` reads the body's premise assertions.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## PR body — canonical form
|
|
36
|
+
|
|
37
|
+
This is the verbatim PR-body template every Developer pastes when opening a PR. Copy the fenced block below into the PR body and fill the placeholders. The `brief-shape` check (CI) and the pull-request open both read the **`Tier:` field** from this body — written exactly as shown, it parses; written any other way (`Tier 1`, `Tier-1`, `Tier:1` without space, etc.) it is rejected.
|
|
38
|
+
|
|
39
|
+
This form is **forge-agnostic.** It depends on no GitHub feature, no `.github/PULL_REQUEST_TEMPLATE.md`, no agent-specific skill. It is the source of truth that travels with the methodology.
|
|
40
|
+
|
|
41
|
+
**Start from the template file:** copy `artifacts/templates/pr-report-template.md` and fill its placeholders — it packages this canonical form as a literal skeleton, with each gate-read field (`Closes #N`, `Project:`, `Tier:`, the Test Plan section) wrapped in its Vinaya anchor pair (an HTML comment pair, invisible on the rendered PR) so a pasted reference brief or quoted example can never be mistaken for the real field. Anchors are optional — prose-only bodies keep parsing exactly as before (`doctrine/enforcement.md`) — but the template seeds them by default; keep them. There is no `## Reference` section to fill, and the PR open rejects a body still carrying either legacy `brief:start`/`brief:end` marker, written under the retired comment prefix.
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## Decisions
|
|
45
|
+
|
|
46
|
+
<one line per choice the brief left open, e.g. `- <choice>: <what you picked
|
|
47
|
+
and why>` — the alternatives you considered and why you picked yours, so the
|
|
48
|
+
Principal can reverse a wrong call. What the diff does is the diff's to say;
|
|
49
|
+
verification results are the Evidence block's.>
|
|
50
|
+
|
|
51
|
+
## Test plan
|
|
52
|
+
|
|
53
|
+
<every runtime-observable check. Pure-logic tasks use the explicit
|
|
54
|
+
`Test Plan: unit-tests-only` sentinel instead of a list. The `[agent]` half is
|
|
55
|
+
a fenced list of commands — one command per line, each with its expected
|
|
56
|
+
observable after a literal `→`. `vinaya-pr-report` runs every line in that
|
|
57
|
+
fence from the PR head and writes the command plus its actual output into the
|
|
58
|
+
`VINAYA:EVIDENCE` block below; there is no `[agent]` checkbox to tick.>
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
<scriptable / non-auth / no-vendor-key command> → <expected observable>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- [ ] **[principal]** <auth-gated / vendor-key-dependent / visual / browser
|
|
65
|
+
check — e.g. signing in with Clerk and running a real BYOK audit. The
|
|
66
|
+
Principal runs this in a browser and ticks the box.>
|
|
67
|
+
|
|
68
|
+
## Evidence
|
|
69
|
+
|
|
70
|
+
Emitted by `vinaya-pr-report --write <body-file>` — see
|
|
71
|
+
[§ Evidence is emitted, never typed](#evidence-is-emitted-never-typed).
|
|
72
|
+
|
|
73
|
+
<!-- VINAYA:EVIDENCE:START -->
|
|
74
|
+
[populated by `vinaya-pr-report --write`]
|
|
75
|
+
<!-- VINAYA:EVIDENCE:END -->
|
|
76
|
+
|
|
77
|
+
## Scope
|
|
78
|
+
|
|
79
|
+
<one-paragraph summary of the blast radius — projects touched, packages
|
|
80
|
+
edited, shared-package consumers affected, non-goals. End with the Tier
|
|
81
|
+
field on its own line:>
|
|
82
|
+
|
|
83
|
+
**Tier:** 1
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Field rules (read once, follow forever):**
|
|
87
|
+
|
|
88
|
+
| Field | Requirement |
|
|
89
|
+
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
90
|
+
| Decisions | One line per choice the brief left open — the alternatives considered and why yours won, not a restatement of the diff. Verification claims (typecheck/lint/test/diff-stat output, pass counts) belong in Evidence; `pr-report-density` holds the section to one block. "No open choices" is a valid value, stated explicitly, same as `Test Plan: unit-tests-only`'s sentinel pattern — a blank section is not. |
|
|
91
|
+
| **Bare digits (whole body)** | `body-bare-digits` (CI) rejects any bare digit outside a fenced/indented/inline code span or `Closes`/`Project`/`Tier`/`Evidence`'s own anchor, correctly placed under its own documented section. `Premise`/`Test plan` get no anchor exemption (their content is free text, scanned like ordinary prose). An Issue/PR ref, a date, a version, a path, a section number each take their own backticks (`` `#N` ``); a countable claim ("138 passed", a duration, a percentage) belongs in a fenced block. |
|
|
92
|
+
| Test plan | Every runtime-observable check. The Issue's `## Test plan` section makes this a **required** field, rendered mechanically into the brief — empty plans use `Test Plan: unit-tests-only` as the sentinel. |
|
|
93
|
+
| `[agent]` fenced list | A fenced block, one command per line, each with `→ <expected observable>`. `vinaya-pr-report` runs every line from the PR head and writes the command plus its actual output into `VINAYA:EVIDENCE` — not a checkbox, not a hand-pasted comment. (This is the `[agent]` half of the Verification phase, see `state-machine.md` § Verification.) |
|
|
94
|
+
| `[principal]` items | Checkbox items only the Principal can run (auth-gated, vendor-key-dependent, visual). The Principal ticks these, after running in a real browser; `review-gate` holds the merge while one is unticked. |
|
|
95
|
+
| Evidence | The `VINAYA:EVIDENCE` block — emitted by `vinaya-pr-report --write`. See [§ Evidence is emitted, never typed](#evidence-is-emitted-never-typed). `evidence-fresh` rejects a body whose block doesn't match the head it's attached to. |
|
|
96
|
+
| Scope | One paragraph + the Tier field. Ends with `**Tier:** 0 \| 1 \| 3` on its own line. |
|
|
97
|
+
| **Tier syntax** | Exactly `Tier: 0`, `Tier: 1`, `Tier: 3` (plain) — or `**Tier:** 0`, `**Tier:** 1`, `**Tier:** 3` (bold). `Tier 1` (no colon), `Tier-1`, `Tier:1` (no space) are **rejected**. |
|
|
98
|
+
| `Doc-ack:` | Optional. `Doc-ack: <pointer> — <note>` — acknowledges an external (URL) binding in `.vinaya/doc-owners` that fired on this PR. `<pointer>` exactly matches the binding URL. Separator is flexible — em-dash `—`, en-dash `–`, or a plain ASCII hyphen `-` (with surrounding whitespace) are all accepted, so `Doc-ack: <pointer> - <note>` parses identically. **Body field, not a label.** (state-machine.md Section 15) |
|
|
99
|
+
| `vinaya/waiver:docs` (label, not a field) | Optional. A doc-coverage waiver is honored PR-wide ONLY when this label is applied AND the actor of its labeling timeline event is a configured principal — there is no body-field waiver grammar; a parseable string is not sufficient. **Principal only**, applied outside any agent session. |
|
|
100
|
+
|
|
101
|
+
**What this section is NOT:** not a style guide, not exhaustive PR etiquette. It is the **contract** for the shapes the PR open, `brief-shape`, `doc-coverage`, `test-plan`, `evidence-fresh`, `body-bare-digits`, `pr-report-density` and `review-gate` read. Add anything you want beneath the four sections; keep all four, in this shape.
|
|
102
|
+
|
|
103
|
+
### Evidence is emitted, never typed
|
|
104
|
+
|
|
105
|
+
The `VINAYA:EVIDENCE` block is populated by `vinaya-pr-report --write <body-file>` — not by hand-typing a diff stat, a test count, or a gate's pass/fail line into the PR body. `vinaya-pr-report --write` both runs the real gates (Group B) and recomputes the diff stat (Group A), so its exit code doubles as a verification run — a red gate still writes the block (recording the failure honestly) but exits non-zero, so a scripted `--write && open-pr` never carries a failing suite onto the forge.
|
|
106
|
+
|
|
107
|
+
`evidence-fresh` (CI) rejects a body whose block doesn't match the head it's attached to — recomputing Group A exactly and checking Group B for staleness. This closes fabrication for **Group A only** (a hand-typed diff stat cannot survive a byte-compare); Group B is checked for freshness, not re-run, so a stale-but-not-fabricated Group B slips past unless the block is also out of date. It closes fabrication for the two facts a checker can cheaply recompute, not for the Decisions section's prose.
|
|
108
|
+
|
|
109
|
+
**After open, regenerating `VINAYA:EVIDENCE` is the driver's job.** Under the review loop the driver runs the same engine `vinaya-pr-report --push` calls, in-process, once your head's independent prerequisites (mergeability) pass and before it waits on CI, because the Evidence-dependent `evidence-fresh` check cannot turn green until that block names your head — every round, retried within a bound and paused as infrastructure when it never reaches the pull request — and posts the round marker comment in your place. `refresh_evidence` is the tool for a regeneration you need mid-turn. Working manually, `vinaya-pr-report --push <n>` regenerates it on the open PR; its `--body-file <path>` mode also splices a section outside the two generated blocks — a Decisions bullet, most often — that only ever existed in a local draft.
|
|
110
|
+
|
|
111
|
+
<!-- VINAYA:CLAIM: harness/processes/vinaya-strict/loops/dev-review/v2/v2-actions.ts contains:const evidence = await writeEvidenceFor(fns, pr, head) -->
|
|
112
|
+
**Under the review-locally, push-once flow (version 2) only: no tests and no `refresh_evidence` in your turn.** In that flow the ready push runs the selected tests on the approved commit, and the driver writes the Evidence block once the pull request opens. Your turn runs the local checks (`run_checks`) and publishes; it runs no test suite and never calls `refresh_evidence`. Every other flow, and manual work, is unchanged: you run the tests and keep the Evidence block fresh as described above.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Documentation is part of every task
|
|
117
|
+
|
|
118
|
+
Documentation is not post-implementation optional cleanup. It is part of the task. A brief is not done until all tier-required documentation artifacts exist and pass verification. Your brief carries an explicit documentation-update list (by file name) — treat it as a DoD obligation, not a suggestion. A task that ships passing tests but incoherent docs is incomplete in the same way a task that ships with failing tests is incomplete. Every doc named in that list is updated before the PR opens; a named doc not in the diff is a finding at review.
|
|
119
|
+
|
|
120
|
+
**Update-or-waive is a DoD gate.** Beyond that list, the `doc-coverage` check enforces code → doc coverage from `.vinaya/doc-owners` in CI. Whenever your diff touches a code surface bound in that file, do exactly one of: (a) update the bound doc in the same PR; (b) for URL bindings, add a `Doc-ack: <pointer> — <note>` body field; (c) have a principal apply the actor-verified `vinaya/waiver:docs` label to the PR — not a body field, and not one you can write yourself. This coverage seam is dormant when `.vinaya/doc-owners` is absent or no binding matches, so a PR that touches no bound surface has no obligation.
|
|
121
|
+
|
|
122
|
+
> The commands shown below are **this repo's** toolchain (Bun/JS). Substitute your repo's declared equivalents. Under the review loop, the controller runs the static gates — see [§ Verification before reporting done](#verification-before-reporting-done). Working manually, with no driver, run the commands named below yourself.
|
|
123
|
+
|
|
124
|
+
### Tier 0 checklist
|
|
125
|
+
|
|
126
|
+
All of the following pass before the PR is opened:
|
|
127
|
+
|
|
128
|
+
- [ ] Under the review loop, the controller's commit hook, push hook, `run_checks`, and CI report the static gates passing.
|
|
129
|
+
- [ ] Working manually: code passes typecheck (this repo: `bun run typecheck`) and lint/format (this repo: `bun run format-and-lint`); the pre-push hook runs affected tests on the one push.
|
|
130
|
+
- [ ] PR description follows the template, carries the report, and declares `Tier: 0`
|
|
131
|
+
|
|
132
|
+
### Tier 1 checklist
|
|
133
|
+
|
|
134
|
+
All Tier 0 items, plus:
|
|
135
|
+
|
|
136
|
+
- [ ] Specs updated to reflect new behavior (if new patterns introduced or existing patterns changed)
|
|
137
|
+
- [ ] Skills updated if conventions shifted in the area being changed
|
|
138
|
+
- [ ] Under the review loop, `run_checks` reports `doc-coverage` passing; working manually, `verify-docs --pr` passes (this repo: `bun run verify-docs --pr`).
|
|
139
|
+
- [ ] `docs-index.md` updated if files were added, removed, or renamed
|
|
140
|
+
|
|
141
|
+
### Tier 3 checklist
|
|
142
|
+
|
|
143
|
+
All Tier 1 items, plus:
|
|
144
|
+
|
|
145
|
+
- [ ] Non-derivable facts surfaced by this task (a new pending manual op, a known production issue) recorded as ordinary open Issues — not in any state document; active-work status is derived from the forge (`now.md` and the pinned state Issue are both retired)
|
|
146
|
+
- [ ] Merge happens at a ratification window (opening the PR is not a request for immediate merge on Tier 3 work)
|
|
147
|
+
|
|
148
|
+
**Hard rule:** If any tier-required item fails, the PR is not ready to open. "I'll fix the doc issues after merge" is not an option — fix them before.
|
|
149
|
+
|
|
150
|
+
**Pre-PR gate, working manually.** Confirm the Tier checklist and doc-owners coverage yourself with `PR_BODY` set to the intended PR body text (`PR_BODY="$(cat /tmp/pr-body.md)" vinaya-check doc-coverage`). **On this repo's toolchain**, `bun harness/processes/vinaya-strict/checks/standalone/verify-docs.ts --pr` runs both — the tier checklist and doc-owners coverage — as one command, and `bun harness/processes/vinaya-strict/checks/standalone/verify-task.ts` wraps typecheck, lint, tests, build, `verify-docs` and a premise re-check into one run scoped to the process package; nothing calls either for you. Where neither script is available, self-verify the tier checklist above.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Spike exception
|
|
155
|
+
|
|
156
|
+
If the brief is tagged `spike: true`:
|
|
157
|
+
|
|
158
|
+
- Reduced checklist: code passes typecheck + lint, with what was tried and learned recorded in the pull request
|
|
159
|
+
- Spike code does NOT merge to main
|
|
160
|
+
- After the spike, the code either rebases away (if the approach is abandoned) or converts to a Tier 1+ task in a new brief
|
|
161
|
+
|
|
162
|
+
A spike is exploratory, not a permanent excuse to skip documentation. The pull request is the durable artifact of the spike.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## After your turn — it ends here
|
|
167
|
+
|
|
168
|
+
Your turn ends once your work is published: dispatched, when `publish_changes` has committed and pushed it and `open_pull_request` has opened the pull request (or it was already open); working manually, when you have committed, pushed and opened the PR yourself. Either way, your turn ends here — for round 1, and for every later round too: after a fix in response to review findings, your turn ends on the same branch, no new PR.
|
|
169
|
+
|
|
170
|
+
Under the review loop, the rest is the driver's:
|
|
171
|
+
|
|
172
|
+
- **The `VINAYA:EVIDENCE` block** is regenerated by the driver itself, in-process, before it waits on your head's CI.
|
|
173
|
+
- **The round marker comment** — `Head: <sha>`, `<!-- vinaya:developer:round-<n> -->`, and from round 2 the ids of the findings you addressed and the checks you report running — is composed and posted by the driver, from your turn result.
|
|
174
|
+
- **A branch behind its base** is caught by the driver's own mergeability check before it dispatches a reviewer or runs the report. A conflicting head comes back to you with the conflicting files named and the one sanctioned way through: a merge of the default branch started without committing, the conflicts resolved, and `publish_changes`, which makes the merge commit.
|
|
175
|
+
- **Ticking `[agent]`/`[principal]` boxes** is no agent's: the `[agent]` half is Evidence, and the `[principal]` boxes are the Principal's.
|
|
176
|
+
|
|
177
|
+
<!-- VINAYA:CLAIM: harness/processes/vinaya-strict/loops/dev-review/standalone/dev-review-loop/turn-result.ts contains:export function turnResultInstruction( -->
|
|
178
|
+
**Your turn result — how every turn ends.** Every dispatched turn, round 1 and every resume alike, ends with one structured turn result, returned as your coding agent's own structured final output (Claude Code `--json-schema`, Codex `--output-schema`, which the driver passes for you): the driver reads nothing else as your result. Its `status` is `completed` when the turn's work is done — with a one-sentence `summary`, your `confidence` (a whole number from 0 to 100), a `confidenceExplanation` of one short sentence, `addressedFindingIds`, `sourceUses` and, optionally, `reportedChecks`; `blocked` when a stop condition halts you — with a typed `blocker`; or `needs_ruling` when only the Principal can decide — with your `question` and the permissible `decisions` to choose between. Your prompt spells out each field. `addressedFindingIds` is empty in round 1; from round 2 on, a turn sent back to fix review findings names the finding ids it addressed, from the list its prompt carries (e.g. `R1-CR-1`, `R1-SEC-2`). `sourceUses` names, for every required source in the brief's `## Documentation`, the decision it informed — and a URL source counts only when the driver recorded your read of it (the `fetch_documentation` tool is the sure route). `reportedChecks` is your own account of what you ran: the driver shows it as context, not as evidence. The driver alone accepts the result: one it rejects is sent back to the SAME session once, naming only the failures, for a corrected result — change and publish nothing for that — and a second rejection pauses the round. A `blocked` or `needs_ruling` result pauses the round for the Principal.
|
|
179
|
+
|
|
180
|
+
Then stop. Review is a separate invocation.
|
|
181
|
+
|
|
182
|
+
## Review handoff
|
|
183
|
+
|
|
184
|
+
The work now enters Phase 10 review (`process.md`):
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
code-reviewer pass → security pass → Principal code review → Planner spec review → merge
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The code-reviewer and security passes are **separate, fresh-context invocations** — not you. You do not review your own work; the independence is the point. What you do:
|
|
191
|
+
|
|
192
|
+
- **Address the findings that block.** A code-review finding at or above the configured `codeReviewThreshold` (BLOCKER when unset) or a security finding at or above `securityThreshold` comes back to you. Fix it on the **same branch** with new commits; the relevant pass re-runs, on the same PR. (Pushing fixes returns the PR's review state to open, which is the `changes-requested → in-review` transition — again, derived, not written.) Your response to the round is not a PR-body section: under the review loop it is your turn result, which the driver posts as the round's comment; working manually, it is one PR comment. A `doc-correctness` finding carries a `Search:` pattern — a repo-wide `git grep -n -iE` pattern, with no path filter — and is resolved only when every hit it returns at the new head is a true statement. So fix every copy, not only the anchored line: re-run that pattern yourself, correct every hit, and report the command and its result at the fixed head in your round response (`reportedChecks` under the review loop). Where the corrected sentence states what code does, bind it with a `VINAYA:CLAIM` marker so the `doc-claims` check keeps it honest.
|
|
193
|
+
- **Fix, don't argue findings into submission.** If a finding is wrong, say why, concisely, in your round response — but the Reviewer's independence means the default is to fix, not to debate.
|
|
194
|
+
- **Leave an escalation alone.** An escalation is its own review outcome, not a finding — it routes to the Planner (`strategy`) or Principal (`authority`/`product`). Wait for direction.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Pushback when the brief is wrong
|
|
199
|
+
|
|
200
|
+
A brief is not infallible. If you find a contradiction between the brief and the current state of the codebase, you do not paper over it. You surface it.
|
|
201
|
+
|
|
202
|
+
A contradiction is not only the codebase-moved-since-the-brief case. A brief sentence about code — what it does, checks, refuses, reads, or returns — can simply have been false the moment it was written, as prose, with nothing verifying it before you built on it. Run each command the brief gives you before the Part that depends on it — other than a static gate the controller runs for you — and report its actual output in your round response; if the output contradicts a sentence already in the brief, that is a brief defect, not something to transcribe into doctrine or code.
|
|
203
|
+
|
|
204
|
+
Escalate with the appropriate severity — under the review loop, a `needs_ruling` or `blocked` turn result; working manually, an escalation note:
|
|
205
|
+
|
|
206
|
+
- `severity: execution` — missing detail, deprecated dependency, flag not anticipated
|
|
207
|
+
- `severity: strategy` — brief assumes approach A but the codebase has gone a different direction
|
|
208
|
+
- `severity: product` — the brief would require a Type 1 decision not specified in the brief
|
|
209
|
+
|
|
210
|
+
**What "contradicts the code irreconcilably" means.** The brief contradicts the code irreconcilably only when the fix needs a path outside the Surface, a protected administrative path the Surface does not cover, or a change of the task's objectives. A file inside the Surface that the Boundary did not pin is not a contradiction: you change it, list it in the pull request's Decisions, and do not pause. A Boundary that names a pinned file is a statement of what the Planner expected to change, not a fence around the rest of the Surface.
|
|
211
|
+
|
|
212
|
+
The brief's stop conditions tell you when to STOP and ask. Honor them. If the stop conditions say "STOP if you discover X" and you discover X, you stop. You do not improvise a workaround.
|
|
213
|
+
|
|
214
|
+
**Refusing or escalating before you have ever pushed, working manually.** An entry-gate refusal, or a stop condition hit before your first commit, happens before a branch or pull request exists — the task Issue is the only place to say so. Post it there as a comment with `<!-- vinaya:developer:stop -->` as its own first line, followed by your reason; the loop reads a principal-authored stop comment and ends the run at once. Once a PR exists, escalate there. Under the review loop the turn result carries the same refusal.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Stop conditions
|
|
219
|
+
|
|
220
|
+
**A plan that no longer fits the default branch.** Under the Engine review loop, call the driver tool `repair_plan` with no arguments before escalating a potentially deterministic plan defect. It calls the same repair function and Issue write gate as dispatch: unchanged-content renames and uncovered-importer disclaimers only. It never edits objectives or widens `## Surface` `in:`. Success returns the repaired frozen brief, its hash and reasons; continue from that brief in the same round. An unrepairable finding returns `human_decision`: report it for a Principal ruling. A tool refusal does not itself pause the round. A driver without this tool returns an explicit unavailable refusal; never repair the brief yourself.
|
|
221
|
+
|
|
222
|
+
Every brief includes stop conditions. Honor them unconditionally. Common reasons to STOP:
|
|
223
|
+
|
|
224
|
+
- Pre-flight checks fail (dirty tree, wrong branch, worktree could not be created cleanly, missing tools, missing reference files)
|
|
225
|
+
- Brief contradicts the current state of the codebase irreconcilably, as defined under "Pushback when the brief is wrong", in a way you cannot resolve without external information
|
|
226
|
+
- A test still fails after genuine diagnosis — but a failing test is yours to fix, in the code or the test. CI on the pull request's head is the authority for a test that fails only inside your sandbox, so a sandbox-only failure is not a block; return `blocked` with reason `test_failure` only when the same test also fails on `origin/main` in a clean checkout
|
|
227
|
+
- Any destructive action (force push, file deletion, database mutation) not explicitly authorized by the brief
|
|
228
|
+
- You discover a decision that should be Type 1 (irreversible) but the brief doesn't mention it
|
|
229
|
+
- GitHub refuses a call, a check or a publication on its rate limit — a GitHub rate limit is never yours to escalate. Return `blocked` with reason `tooling_unavailable`, naming the rate limit, and never `needs_ruling`: the loop waits for the reset and dispatches you again. This holds whichever coding agent runs you
|
|
230
|
+
- A link or file the task references cannot be opened, unless the brief lists that file to create — stop at once and return a `blocked` turn result with kind `preflight_failed`, naming the reference. For a URL under the review loop, "cannot be opened" means the driver's `fetch_documentation` tool failed to read it; a `curl` or other network call your sandbox blocks never counts, so read the URL with `fetch_documentation` before deciding. Working without the driver's tools, it means your own fetch failed. Never develop around it: the task named it because the work needs what it holds.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## What the Developer does NOT do
|
|
235
|
+
|
|
236
|
+
The short version's **You never** list holds; these are the ones that need a reason.
|
|
237
|
+
|
|
238
|
+
- **Author own briefs.** If you run out of brief, stop. Don't invent scope.
|
|
239
|
+
- **Write status.** Status is derived from the forge. You never edit a status field or the tranche file — opening the branch/PR and merging are the transitions.
|
|
240
|
+
- **Skip permission prompts** (e.g. a "dangerously skip permissions" flag) unless the brief authorizes it.
|
|
241
|
+
- **Modify another Developer's in-progress worktree.** Each task has its own worktree; cross-worktree changes create conflicts that are hard to untangle.
|
|
242
|
+
- **Commit a new file whose sole purpose is a report, finding, or audit summary.** A one-off deliverable — a coverage report, an audit result, a findings writeup — goes in the PR body or an Issue/PR comment, not a new repo file. This has already broken Vinaya Studio once (a committed audit deliverable was silently parsed as a broken tranche by the Studio loader).
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Worktree discipline
|
|
247
|
+
|
|
248
|
+
When dispatched by an automation layer, the driver already created your worktree — OUTSIDE any sandbox, before your first turn ever ran — at `.worktrees/task/<tranche>/<n>/` on branch `task/<tranche>/<n>`, cut from `origin/main`, and already pushed that branch to the remote with its upstream set. The brief's own Step 0 only enters it (`cd .worktrees/task/<tranche>/<n> && bun install …`).
|
|
249
|
+
|
|
250
|
+
When working manually (no driver watching), nobody created it for you. Create it yourself, BEFORE running the brief's own Step 0:
|
|
251
|
+
- `git worktree add .worktrees/task/<tranche>/<n> -b task/<tranche>/<n> --no-track origin/main && cd .worktrees/task/<tranche>/<n> && git config push.autoSetupRemote true`
|
|
252
|
+
- Then `git worktree list` to confirm you're not accidentally working in another task's worktree
|
|
253
|
+
- Branch from `origin/main`, not from `HEAD` of the current local checkout (which may be behind)
|
|
254
|
+
- Confirm the branch was created correctly: `git log --oneline -3` should show the expected parent
|
|
255
|
+
- Then run the brief's own Step 0 as written
|
|
256
|
+
|
|
257
|
+
The `task/<tranche>/<n>` branch name is the convention that lets any role find this task's branch and PR (and therefore its derived status) with one forge query.
|
|
258
|
+
|
|
259
|
+
Working manually, before the push `git status` shows a clean tree, and after every commit `git log --oneline -3` confirms the new commit is a direct child of the expected parent — a mixed reset between sessions can leave HEAD at an older ancestor silently. (Under the review loop, `publish_changes` refuses a head that moved during the turn.)
|
|
260
|
+
|
|
261
|
+
**Stash is off-limits in a shared-repo worktree.** Never `git stash` while working in `.worktrees/task/<tranche>/<n>/`. Stash refs are global across every worktree of a shared repo clone — a stray `stash pop` run in one task's worktree can pop a *different* task's in-progress stash, silently corrupting its uncommitted work. This is not hypothetical: a near-miss surfaced live on a task branch's own PR. Working manually, set aside in-progress changes with a WIP commit on your own branch instead (`git commit -m "Chore: WIP checkpoint"` — squashed away before opening the PR); under the review loop, leave them uncommitted for `publish_changes`.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Commit conventions
|
|
266
|
+
|
|
267
|
+
- Format: `Type(scope): Brief description` — start-case type, optional lower-case scope in parens, colon, space, description. The `commit-msg` hook checks this shape on every commit; `publish_changes` checks it, and the 72-character ceiling, on the header you pass it.
|
|
268
|
+
- Types: `Feat`, `Fix`, `Refactor`, `Style`, `Docs`, `Chore`, `Test`, `Perf`, `Build`, `Revert`
|
|
269
|
+
- Working manually, nothing checks the header length for you: keep every header at 72 characters or fewer, and before opening the PR run `git log origin/main..HEAD --format="%s" | awk '{ if (length > 72) print NR": "length" chars (OVER LIMIT): "$0 }'`, which prints nothing when all fit.
|
|
270
|
+
- Subject is sentence-case (not ALL CAPS, not all lowercase), with no trailing period
|
|
271
|
+
- Reference the task's Issue in the PR body (`Closes #N`), not necessarily in every commit message
|
|
272
|
+
- No agent self-attribution / "generated by" trailers in commit messages
|
|
273
|
+
- A change to a published package's shipped files carries its `.changeset/*.md` entry in the same PR — the `changeset-coverage` check (`doctrine/enforcement.md`) blocks a push and fails CI on a diff that misses this; a change that ships nothing users see declares that with an empty changeset (`bunx changeset add --empty`)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Prose is self-contained
|
|
278
|
+
|
|
279
|
+
A code comment, a pull-request body, and a doctrine page each describe the thing itself — what the code does, what changed, what a reader needs in order to act — not an internal batch-of-work label or a forge number standing in for that description. A citation is a pointer only this repository's own history can resolve; a reader without that history (a fork, an export, someone reading the file in five years after the Issue is closed) gets nothing from it. Where the fact is worth recording, write the fact — what was learned, decided, or fixed — not where it was logged. `reader-resolvable-prose`'s source-comment class enforces this mechanically over `.ts` comment lines under the configured source globs (`harness/processes/vinaya-strict/tools/reader-resolvable-prose.ts`); treat a citation it flags the same as a failing test, not a style nit to defer.
|
|
280
|
+
|
|
281
|
+
## When to escalate
|
|
282
|
+
|
|
283
|
+
| Situation | Action |
|
|
284
|
+
|-----------|--------|
|
|
285
|
+
| Brief contradicts codebase reality | Escalate, severity: execution |
|
|
286
|
+
| Architectural choice not specified in brief | Escalate, severity: strategy |
|
|
287
|
+
| Type 1 decision discovered during execution | Escalate, severity: product |
|
|
288
|
+
| `pre-push` prints a C5 doc-owners warning on a branch's **first** push (no PR open yet) | NOT an escalation — the push succeeds (ring 0 is warn-only). If the doc is genuinely stale, update it in this branch. If you believe it does not need updating, say so in the PR body when you open the PR and note that ring 1 stays red until a principal applies the `vinaya/waiver:docs` label — you cannot self-serve this waiver. Escalate to the Principal only if you are unsure whether the doc is actually stale. |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Verification before reporting done
|
|
293
|
+
|
|
294
|
+
Under the review loop, static gates are controller work: you do not hand-run typecheck, lint/format, the build, the documentation gate, or the affected-test selection, or paste their output. The commit hook applies safe format/lint fixes to staged files, typechecks affected packages, and runs Vinaya checks. The pre-push hook runs `bun harness/processes/vinaya-strict/integration/pre-push-select-tests.ts | xargs -r bun test --timeout=30000 --` on each push `publish_changes` makes; `run_checks` and CI are the authoritative reports, and CI runs the full suite (`bun run test`). A check you ran by hand is context in `reportedChecks`, not a reason to return a `blocked` turn result. Treat only a failure returned by `run_checks`, a hook, or CI as a gate failure, and fix it before continuing.
|
|
295
|
+
|
|
296
|
+
Before you say you are done or open a PR under the review loop:
|
|
297
|
+
|
|
298
|
+
1. Publish through `publish_changes` and read its result — it validates the commit header and runs the publication hooks; use `run_checks` for the current head and read its result.
|
|
299
|
+
2. `git diff origin/main...HEAD --stat` is context for the report only; Surface is judged by the driver's `surface-scope` check.
|
|
300
|
+
|
|
301
|
+
Working manually, with no driver, run the same static gates yourself before opening: `bun run typecheck`, `bun run format-and-lint`, the repository's production build, and `bun run verify-docs --pr`. The pre-push hook runs the affected suite once on the push.
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Verification — the phase between review and merge
|
|
306
|
+
|
|
307
|
+
The checks above are **static**: they prove the change compiles, lints, types and matches its declared surface. They do not prove the feature works. Verification is the separate, mandatory phase that runs the brief's Test Plan against a booted app, after the review passes and before the Principal merges.
|
|
308
|
+
|
|
309
|
+
**It is a phase, not an actor.** There is no Verifier to dispatch. The plan splits by who can structurally execute it: `vinaya-pr-report` runs the `[agent]` half's fenced command list from the PR head and writes it into `VINAYA:EVIDENCE`; the Principal runs the `[principal]` half in a real signed-in browser and ticks its boxes. Both halves are satisfied before a merge is allowed — the `[agent]` half by the Evidence block existing and matching a fresh recompute (`evidence-fresh`), the `[principal]` half by every `[principal]` box in the PR body being ticked, which `review-gate` checks — `test-plan` grades the `[agent]` half and the plan's structure only; it is `principalOwed`, so its own `pending` failure never blocks the loop's mechanical gate, and enforcement of the unticked box lives at `review-gate` instead.
|
|
310
|
+
|
|
311
|
+
**Live proofs needing an operator login stay on the host.** Never run a proof command that starts a real subscription-authenticated coding-agent session from inside the Developer sandbox: the operator's login is unreachable there. Build the command and its tests, list the exact command lines in the pull request's `[principal]` test-plan items, and leave the operator to run them on the host and add the resulting output.
|
|
312
|
+
|
|
313
|
+
**Why it exists:** four consecutive features once merged with green CI and were broken at runtime — a missing migration, a missing environment variable, a missing provider, an unexecuted test plan. The static gates ran and passed; the reviews read the diff; nobody booted the app. Verification is the phase that closes that gap.
|
|
314
|
+
|
|
315
|
+
### Refuse if it isn't your turn
|
|
316
|
+
|
|
317
|
+
- **No open PR** — nothing to verify; come back when one is open.
|
|
318
|
+
- **No `vinaya:brief:v1` comment on the task Issue** — without a Test Plan there is no definition of "verified"; `vinaya-task-brief` posts the frozen brief comment first.
|
|
319
|
+
- **No Test Plan section in the brief** — the brief is malformed; flag it for correction and stop rather than inventing a plan at verification time.
|
|
320
|
+
- **The plan declares `unit-tests-only` but the diff touches a runtime surface** (a route, a page, a server action) — the brief was mis-declared; flag it for correction. This is the failsafe against quietly downgrading verification.
|
|
321
|
+
|
|
322
|
+
If the brief declares `unit-tests-only` and the diff really is pure logic, the phase is satisfied by the unit-test gate; record that as the outcome.
|
|
323
|
+
|
|
324
|
+
### The `[agent]` half — under the loop, the driver's; standalone, yours
|
|
325
|
+
|
|
326
|
+
**Under the automated dev-review loop, this already ran.** The driver's own per-round evidence report (see [§ After your turn — it ends here](#after-your-turn--it-ends-here)) executes the SAME §9 fenced command list, from the SAME PR head, into the SAME `VINAYA:EVIDENCE` block, before it waits on your head's CI — every round, automatically.
|
|
327
|
+
|
|
328
|
+
**If you are working outside the loop** — dispatched by hand, with no driver watching this PR — the phase is still yours to run explicitly:
|
|
329
|
+
|
|
330
|
+
1. **Boot the app(s)** named in the brief from the worktree, and wait until each is reachable, if your §9 fenced commands need one running. If it does not boot, that is the failure — the plan never gets a chance to run.
|
|
331
|
+
2. **Run `vinaya-pr-report --push <n>`.** It executes every line in your §9 fenced command list from the PR head and writes each command plus its actual output into `VINAYA:EVIDENCE` — not a hand-pasted comment, not a checkbox tick. A command this tool did not run is not evidence. **Accepted risk, Principal default:** `pr report --push` executes the PR's own §9 commands on the machine running it, with no check of who is running it — only the PR's author runs it; nothing enforces that today.
|
|
332
|
+
3. **Stop there.** The `[principal]` items are not yours to execute; mark them as awaiting the Principal.
|
|
333
|
+
|
|
334
|
+
A failed `[agent]` command makes the PR unmergeable (`vinaya-pr-report`'s own exit code reflects it, and `evidence-fresh` binds the recorded output to the PR head). Fix on the same branch — under the loop, the next round's own automatic report overwrites the block with fresh output; standalone, re-run `vinaya-pr-report --push <n>` yourself — either way it overwrites, never appends a second copy.
|
|
335
|
+
|
|
336
|
+
### The `[principal]` half — not yours
|
|
337
|
+
|
|
338
|
+
The Principal executes the auth-gated, key-dependent and visual items in a browser and ticks those boxes. Never tick one because the `[agent]` items passed: they prove different properties. Never re-tag a `[principal]` item as `[agent]` to complete your half — that asymmetry is the whole point of the split, and erasing it is the failure this phase exists to prevent.
|
|
339
|
+
|
|
340
|
+
### What this phase does not do
|
|
341
|
+
|
|
342
|
+
It does not edit code (failures go back to you as the Developer), does not author tests (the plan comes from the brief), does not merge (only the Principal does), does not write status anywhere, and does not replace the code review or the security pass — a change can pass both and still be broken at runtime.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Pre-merge gate
|
|
347
|
+
|
|
348
|
+
The merge waits on three conditions, which `review-gate` and `evidence-fresh` check in CI:
|
|
349
|
+
|
|
350
|
+
1. **Reviewer approved.** The PR carries an approving verdict — from a human, an installed review-bot GitHub App, or another agent.
|
|
351
|
+
2. **`[agent]` evidence fresh.** The `VINAYA:EVIDENCE` block's third group (the §9 fenced command list, run by `vinaya-pr-report`) matches a fresh recompute at the PR head.
|
|
352
|
+
3. **Principal confirmation.** The PR body's Test Plan section has no unchecked `- [ ] **[principal]**` lines.
|
|
353
|
+
|
|
354
|
+
Before any merge-adjacent action (commenting "MERGE", helping the Principal merge, or pushing a "fix CI" commit after review), read the three: under the review loop through `read_pull_request`; working manually through `gh pr view <n> --json reviews,statusCheckRollup,body`. If any is missing, say exactly which — your turn result under the loop, a PR comment working manually — and stop. The Principal decides what to do next.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Anti-patterns
|
|
359
|
+
|
|
360
|
+
These are failures the Developer actively avoids. Several come from real incidents.
|
|
361
|
+
|
|
362
|
+
**Fallback approaches without proving the preferred approach is impossible.** If the brief says "use Library X," demonstrate X is impossible before switching to Y. Don't silently choose Y because it was easier.
|
|
363
|
+
|
|
364
|
+
**Editing docs to match broken implementations.** The implementation is broken; the doc is correct. Fix the implementation.
|
|
365
|
+
|
|
366
|
+
**Force-pushing without verifying merge will work (manual path).** Test with `git merge --dry-run` or open the PR first to see if there are conflicts.
|
|
367
|
+
|
|
368
|
+
**Pre-push verification that omits production build (manual path).** A dev-mode typecheck can pass while the production build fails under stricter resolution (e.g. a frozen-lockfile install). Run the production build too, where the repo has one.
|
|
369
|
+
|
|
370
|
+
**Reporting "all green" when you ran a subset of checks.** If you ran typecheck but not tests, say so. Don't round up. Partial verification plus a confident summary is how bugs reach main.
|
|
371
|
+
|
|
372
|
+
**Fabricating verification output.** This has happened. Report what a command actually printed — in `reportedChecks`, or a PR comment working manually — and elide long output openly rather than paraphrasing it.
|
|
373
|
+
|
|
374
|
+
**Marking items complete on a checklist without verification evidence.** A check means you ran the command and saw the expected output — not that you believe it should pass.
|
|
375
|
+
|
|
376
|
+
**Starting on the wrong branch (manual path).** Check `git branch` and `git log --oneline -3` before writing any code. Fix the branch before proceeding.
|