Skip to content

Commit 0c46856

Browse files
Sync iteration-025 latency fast paths (small-gate review skip, proportional review-lite, lead slim) (#16)
* feat: add small-gate review skip, proportional review-lite, and phase-0 telemetry * fix: obfuscate private hostname fragment in leak scanner; drop stale SearXNG and Synology docs * fix: bump browserslist to patched release for dependency-audit (GHSA-c83g-rgw3-j3cx, GHSA-73wf-gq98-2v4g) --------- Co-authored-by: Juan Carlos Rodicio <jc.rodicio@lookiero.com>
1 parent 8bc4bf3 commit 0c46856

17 files changed

Lines changed: 617 additions & 83 deletions

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ Use the smallest useful flow:
240240
one-to-six-iteration budget, a hard ceiling of six, durable state, and
241241
reviewer-only closure. Final approval stops the cycle immediately.
242242

243+
### Small-gate fast path
244+
245+
A declared `small` change of at most two files may skip final review when it
246+
does not touch protected surfaces (auth, secrets, public API, migrations, CI,
247+
or the harness itself), is not destructive, and does not require new tests.
248+
`lead` then records `review_skipped_reason: small_gate_pass`. Medium and large
249+
work, and any sensitive surface, still get a full `reviewer` verdict. The
250+
unique gate definition lives in `opencode/docs/ai/harness/agents.md`.
251+
243252
## Included agents
244253

245254
| Agent | Responsibility |
@@ -892,7 +901,6 @@ node scripts/check-harness.mjs
892901
│ ├── quickstart.md
893902
│ ├── security.md
894903
│ ├── superpowers.md
895-
│ ├── synology.md
896904
│ ├── troubleshooting.md
897905
│ └── workflows.md
898906
├── opencode/
@@ -1028,7 +1036,6 @@ Detailed guides are available in [`docs/`](docs/):
10281036
- [Threat model](docs/threat-model.md)
10291037
- [Reproducible use cases](docs/use-cases/README.md)
10301038
- [Troubleshooting](docs/troubleshooting.md)
1031-
- [Synology notes](docs/synology.md)
10321039
- [Awesome OpenCode submission draft](docs/distribution/awesome-opencode-submission.md)
10331040

10341041
## Compatibility and scope

docs/releases/v1.0.28.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,4 @@ separate non-blocking observation.
6767

6868
The public package excludes private OpenCode configuration, local provider and
6969
MCP wiring, credentials, authentication files, raw transcripts, private
70-
evidence, user-specific absolute paths, and machine-local state. In particular,
71-
the local SearXNG research integration is not part of this release.
70+
evidence, user-specific absolute paths, and machine-local state.

docs/releases/v1.0.29.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,4 @@ limits.
7474
The public release excludes private OpenCode configuration, local provider and
7575
MCP wiring, credentials, authentication files, raw transcripts, private
7676
evidence, user-specific absolute paths, machine-local state, and internal Slice
77-
1.5 planning artifacts. In particular, the local SearXNG research integration
78-
is not part of this release.
77+
1.5 planning artifacts.

docs/synology.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

opencode/agents/developer.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ objective, decisions made, files read/touched, validation state, blockers, and
145145
next action. If there are long outputs, reference the artifact path instead of
146146
copying the log into context.
147147

148+
Small-scope exemption: if the handoff includes the condensed 6-field card
149+
(objective, success, validation, diff base, constraints, output) and the task
150+
meets the small-gate defined uniquely in `docs/ai/harness/agents.md`, work
151+
against that card without expanding the full Task Contract or `handoff_packet`.
152+
In that case the card's `output` absorbs the essentials of the Result Contract
153+
and Verification Envelope in a short summary; otherwise the full blocks above
154+
and below remain mandatory.
155+
148156
## Result Contract and Verification Envelope
149157

150158
When closing a non-trivial implementation, add a compact `Result Contract`:

opencode/agents/lead.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ If you choose direct mode, invoke `developer` with:
102102
- minimum acceptance criteria;
103103
- expected validation.
104104

105+
If the small-gate in `docs/ai/harness/agents.md` also applies, delegate with its
106+
condensed 6-field card (canonical example there) instead of a full Task
107+
Contract, `handoff_packet`, and Result/Verification blocks; record
108+
`review_skipped_reason` at closeout.
109+
105110
Do not mentally implement the solution before delegating. Any handoff to another
106111
agent must be self-contained and include:
107112

@@ -118,12 +123,9 @@ decision made, and relevant paths are enough.
118123

119124
## Skill Resolution
120125

121-
Before delegating non-trivial work to a subagent:
122-
123-
1. If `docs/ai/harness/skill_registry.md` exists, read it.
124-
2. Filter skills allowed for the destination agent.
125-
3. Select only skills relevant to the task, with a maximum of 0-3 per handoff.
126-
4. Include a `Skill Resolution` block in the handoff prompt:
126+
Before delegating non-trivial work, consult `docs/ai/harness/skill_registry.md`
127+
only when it exists and is readable or there is an explicit match. Then select
128+
0-3 skills and emit:
127129

128130
```
129131
## Skill Resolution
@@ -134,8 +136,8 @@ Before delegating non-trivial work to a subagent:
134136
- fallback_policy: if registry is missing, use global <available_skills>
135137
```
136138

137-
5. Prefer fewer skills over filling slots.
138-
6. If no skill clearly matches, select none.
139+
If the registry is missing or no skill clearly matches, emit no block and no
140+
dead path pointers. Prefer fewer skills over filling slots.
139141

140142
## Auto-Forecast
141143

@@ -182,6 +184,17 @@ Examples:
182184

183185
Use the full phased flow only when there is real uncertainty, visual/product impact, technical decision-making, medium or large scope, or an explicit slash command.
184186

187+
## Fast router and phase model
188+
189+
Explicit precedence: fast router first. A small, well-routed free-form message
190+
exits the phase model early under the SAME hard exclusions as the small-gate:
191+
protected path, destructive diff, or medium/large with real uncertainty =>
192+
phased flow with final review; slash-command flows => full model. Canonical
193+
sequence: 1 Intake -> 2 Discovery -> 3 Synthesis -> 4 Specification ->
194+
5 Implementation -> 6 Review -> 7 Closure. Do not restart phases or add agents
195+
because of the count. On-demand AHE templates:
196+
`docs/ai/harness/playbooks/lead-ahe-flow.md`.
197+
185198
## Required execution model
186199

187200
Use explicit phase barriers:
@@ -207,8 +220,13 @@ Do not skip phases unless the work is genuinely trivial or you explicitly routed
207220
implementation correction goes back to `developer`.
208221
- Never invoke `reviewer` before there is a diff or implementation to review.
209222
- Every reviewable change requires a canonical `review_stage: final` envelope
210-
from `reviewer` before closure. Give it the objective, non-goals, task/spec,
211-
diff base, and original evidence; a developer summary is not a substitute.
223+
from `reviewer` before closure, except the small-gate defined uniquely in
224+
`docs/ai/harness/agents.md` (declared small + `<=2` files + no protected or
225+
destructive paths + no required tests). Then close without reviewer and
226+
record `review_skipped_reason: small_gate_pass`; outside the gate use the
227+
reason enum. When review proceeds, give it the objective, non-goals,
228+
task/spec, diff base, and original evidence; a developer summary is not a
229+
substitute.
212230
- If `reviewer` returns `verdict: needs_changes`, synthesize the blocking
213231
findings, send a bounded correction task to `developer`, then invoke
214232
`reviewer` again. If it returns `blocked`, obtain the missing evidence or
@@ -255,6 +273,15 @@ When useful, include:
255273
## Closure
256274

257275
A task is closed only when there is concrete output, reasonable validation or a
258-
clear reason validation was not run, a final reviewer envelope has verdict
259-
`pass` or `pass_with_observations`, no blocking findings remain, and risks are
260-
explicit.
276+
clear reason validation was not run, and either a final reviewer envelope with
277+
verdict `pass` or `pass_with_observations` and no blocking findings, or the
278+
small-gate with `review_skipped_reason`. Make risks explicit.
279+
280+
## AHE for harness evolution
281+
282+
Changing agents, commands, skills, tools, or global rules is observable harness
283+
work: evidence -> root cause -> manifest -> bounded changes -> re-evaluation ->
284+
attribution -> review. Details:
285+
`docs/ai/harness/playbooks/lead-ahe-flow.md`. Each change declares evidence,
286+
root cause, component, predicted fixes, risks, and keep/improve/rollback+pivot.
287+
Without git there is no automatic rollback; do not simulate one.

opencode/agents/reviewer.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ For `/plan`, apply the same contract to the objective, research, plan/spec,
8484
assumptions, risks, acceptance criteria, and validation design even when no
8585
implementation diff exists. State that limitation.
8686

87+
## Proportional review by scope
88+
89+
Verdict rigor does not change with scope; review depth must be proportional:
90+
91+
- Review levels are `skipped`, `trivial`, `lite`, and `full`, with the
92+
semantics defined in `docs/ai/harness/commands.md` (section
93+
`/review-preflight`). The caller chooses the level from the small-gate in
94+
`docs/ai/harness/agents.md`; this skill does not add new profiles.
95+
- When review runs at small or medium scope (`lite`), consume the developer's
96+
`Verification Envelope` first (`diff_base`, `review_scope`, `commands_run`,
97+
`results`, `not_run`, `evidence`) as the authoritative record of checks
98+
already run. Do not re-implement suites that envelope leaves green: repeat a
99+
check only with a founded suspicion of the result, or when the envelope is
100+
missing/incomplete for a blocking surface.
101+
- In `lite`, spot-check the real diff and its direct consumers. Mark checks
102+
adopted from the envelope as `envelope-reused` in the output section
103+
`Checks reviewed/repeated`.
104+
- For medium/large work and sensitive surfaces (auth/sessions, secrets,
105+
exported public API, migrations, CI, harness) apply full verification and
106+
the intact final verdict with no shortcuts: never substitute that depth with
107+
trust in the envelope.
108+
87109
## Task Contract And Skill Resolution
88110

89111
Confirm these Task Contract fields when applicable: `objective`,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{"schema_version":1,"scenario_id":"freeform-tiny-copy-trivial","observation_coverage":{"session_events":"complete","skill_events":"complete","tool_events":"complete","review_events":"complete","stop_events":"complete"},"git_snapshot":"changed","events":[{"sequence":1,"type":"session_started","session_id":"root","parent_session_id":null,"agent":"lead"},{"sequence":2,"type":"session_started","session_id":"s1","parent_session_id":"root","agent":"developer"},{"sequence":3,"type":"tool_call_completed","session_id":"s1","agent":"developer","tool":"apply_patch","mutation":"write"},{"sequence":4,"type":"session_completed","session_id":"s1","agent":"developer"},{"sequence":5,"type":"session_started","session_id":"s2","parent_session_id":"root","agent":"reviewer"},{"sequence":6,"type":"review_completed","session_id":"s2","agent":"reviewer","verdict":"approved"},{"sequence":7,"type":"session_completed","session_id":"s2","agent":"reviewer"},{"sequence":8,"type":"stop_observed","condition":"task-completed"}]}
2+
{"schema_version":1,"scenario_id":"freeform-tiny-toy-single-file-full-pipeline","observation_coverage":{"session_events":"complete","skill_events":"complete","tool_events":"complete","review_events":"complete","stop_events":"complete"},"git_snapshot":"changed","events":[{"sequence":1,"type":"session_started","session_id":"root","parent_session_id":null,"agent":"lead"},{"sequence":2,"type":"session_started","session_id":"s1","parent_session_id":"root","agent":"researcher"},{"sequence":3,"type":"session_completed","session_id":"s1","agent":"researcher"},{"sequence":4,"type":"session_started","session_id":"s2","parent_session_id":"root","agent":"specifier"},{"sequence":5,"type":"session_completed","session_id":"s2","agent":"specifier"},{"sequence":6,"type":"session_started","session_id":"s3","parent_session_id":"root","agent":"developer"},{"sequence":7,"type":"tool_call_completed","session_id":"s3","agent":"developer","tool":"apply_patch","mutation":"write"},{"sequence":8,"type":"session_completed","session_id":"s3","agent":"developer"},{"sequence":9,"type":"session_started","session_id":"s4","parent_session_id":"root","agent":"reviewer"},{"sequence":10,"type":"review_completed","session_id":"s4","agent":"reviewer","verdict":"approved"},{"sequence":11,"type":"session_completed","session_id":"s4","agent":"reviewer"},{"sequence":12,"type":"stop_observed","condition":"task-completed"}]}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{"schema_version":1,"id":"freeform-tiny-copy-trivial","category":"trivial","prompt":"Change the Save button label to Save changes in a single HTML file and verify the diff.","command_path":"freeform","expected_root_agent":"lead","required_agents":["developer"],"forbidden_agents":["reviewer","evaluator","debugger","evolver"],"allowed_skills":[],"forbidden_skills":[],"write_before_spec_policy":"allowed","review_policy":"forbidden","expected_stop_condition":"task-completed","maximum_delegation_budget":1,"required_evidence":["static_contract"]}
2+
{"schema_version":1,"id":"freeform-tiny-toy-single-file-full-pipeline","category":"trivial","prompt":"Create a single HTML file with a canvas animation of a Rubik cube and verify the diff.","command_path":"freeform","expected_root_agent":"lead","required_agents":["developer"],"forbidden_agents":["researcher","specifier","reviewer","evaluator","debugger","evolver"],"allowed_skills":[],"forbidden_skills":[],"write_before_spec_policy":"allowed","review_policy":"forbidden","expected_stop_condition":"task-completed","maximum_delegation_budget":1,"required_evidence":["static_contract"]}

opencode/docs/ai/harness/agents.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,33 @@ generate or modify frontmatter.
8383
- `evaluator`, `debugger`, and `evolver` are optional sidecars.
8484
- `evolver` works only on the OpenCode harness.
8585

86+
### Small-gate closeout without review
87+
88+
This is the unique, computable definition of "small" that may skip final
89+
review. `lead` and the condensed Task Contract card consume this SAME
90+
definition; no second definition exists in other contracts. The gate holds
91+
ONLY when every condition is true:
92+
93+
1. Scope declared `small` in the handoff or Task Contract.
94+
2. `diff_files_changed <= 2` counted against the real diff base.
95+
3. No file touches a protected path: auth/sessions, secrets/.env, exported
96+
public API, migrations, CI, or the harness itself (`agents/**`,
97+
`commands/**`, `docs/ai/harness/**`, `scripts/**`, `AGENTS.md`,
98+
`docs/ai/evolution/benchmarks/**`, `skills/**`).
99+
4. Diff is not destructive: no mass deletes, no reverts of others' work, no
100+
permission or security-config changes.
101+
5. The touched surface does not require new or mandatory tests.
102+
103+
Point-3 exclusions beat any size or prompt-length heuristic. When closing
104+
through this gate, `lead` records `review_skipped_reason: small_gate_pass`.
105+
The closed enum is: `small_gate_pass | protected_surface | destructive_diff |
106+
tests_required | scope_not_small | human_decision`; the other values document
107+
why the fast path did not apply, or an explicit human decision.
108+
109+
This gate does not reduce `reviewer` authority: medium/large work and every
110+
sensitive surface keep a full `review_stage: final` with a single final
111+
`reviewer` verdict. It does not apply retroactively to work already reviewed.
112+
86113
## Mission runtime projection
87114

88115
`mission-status` is a read-only view over the durable loop snapshot and
@@ -130,6 +157,29 @@ when the change is not trivial. The minimum block is:
130157
- `validation`: commands, tests, or evidence.
131158
- `ask_abort_triggers`: conditions for asking, blocking, or returning work.
132159

160+
### Condensed card for small scope
161+
162+
When the change meets the small-gate in the section above ("Small-gate closeout
163+
without review", same unique definition), `lead` may delegate and `developer`
164+
may close with a condensed 6-field card instead of the full Task Contract,
165+
`handoff_packet`, and separate Result Contract / Verification Envelope stack.
166+
This is an activation exemption, not a new contract: for non-trivial work every
167+
prior block remains mandatory. Canonical audited example, exactly 6 fields:
168+
169+
```text
170+
small-card:
171+
objective: rename the Save button to Save changes
172+
success: visible label changed in the UI
173+
validation: grep the literal + local render smoke
174+
diff_base: working tree on HEAD (1 file)
175+
constraints: do not touch other literals or tests
176+
output: short summary with the applied diff
177+
```
178+
179+
When closing this way, `lead` records `review_skipped_reason` from the gate
180+
enum. Telemetry (turn ids, timestamps, diff size) ALWAYS stays out of the
181+
card: it lives only in evidence-collector output.
182+
133183
For long, multi-agent, or resumable work, the responsible agent adds a compact
134184
`handoff_packet` with current objective, decisions made, files read/touched,
135185
validation state, blockers, and next action. Long logs are referenced by path

0 commit comments

Comments
 (0)