project-tiny-context-harness 0.2.79 → 0.2.81

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.
Files changed (39) hide show
  1. package/README.md +17 -15
  2. package/assets/README.md +17 -15
  3. package/assets/README.zh-CN.md +19 -9
  4. package/assets/agents/AGENTS_CORE.md +42 -42
  5. package/assets/github/harness.yml +1 -1
  6. package/assets/skills/composite-long-task-workflow/SKILL.md +218 -0
  7. package/assets/skills/composite-long-task-workflow/assets/execution-binding.template.md +33 -0
  8. package/assets/skills/composite-long-task-workflow/assets/goal-objective.template.md +26 -0
  9. package/assets/skills/composite-long-task-workflow/references/composite-long-task-workflow-protocol.md +644 -0
  10. package/assets/skills/normal-long-task/SKILL.md +12 -12
  11. package/dist/commands/composite-long-task.d.ts +6 -0
  12. package/dist/commands/composite-long-task.js +103 -0
  13. package/dist/commands/index.js +5 -3
  14. package/dist/commands/superpowers.js +6 -87
  15. package/dist/lib/composite-long-task-renderer.d.ts +12 -0
  16. package/dist/lib/composite-long-task-renderer.js +109 -0
  17. package/dist/lib/superpowers-task-assertion-normalizers.d.ts +3 -0
  18. package/dist/lib/superpowers-task-assertion-normalizers.js +67 -0
  19. package/dist/lib/superpowers-task-assertions.d.ts +20 -0
  20. package/dist/lib/superpowers-task-assertions.js +242 -0
  21. package/dist/lib/superpowers-task-compile-diagnostics.d.ts +5 -0
  22. package/dist/lib/superpowers-task-compile-diagnostics.js +20 -0
  23. package/dist/lib/superpowers-task-compile-guards.d.ts +2 -0
  24. package/dist/lib/superpowers-task-compile-guards.js +66 -0
  25. package/dist/lib/superpowers-task-compile.js +26 -6
  26. package/dist/lib/superpowers-task-conformance.d.ts +2 -0
  27. package/dist/lib/superpowers-task-conformance.js +24 -0
  28. package/dist/lib/superpowers-task-derive.js +61 -5
  29. package/dist/lib/superpowers-task-gates.js +62 -6
  30. package/dist/lib/superpowers-task-source-compile.js +94 -14
  31. package/dist/lib/superpowers-task-source-parser.js +20 -18
  32. package/dist/lib/superpowers-task-state-schema.d.ts +61 -1
  33. package/dist/lib/superpowers-task-state.js +19 -3
  34. package/dist/lib/superpowers-task-status.d.ts +2 -0
  35. package/dist/lib/superpowers-task-status.js +14 -0
  36. package/dist/lib/superpowers-task-validator.d.ts +1 -0
  37. package/dist/lib/superpowers-task-validator.js +30 -4
  38. package/package.json +5 -5
  39. package/assets/skills/superpowers-long-task/SKILL.md +0 -612
@@ -0,0 +1,644 @@
1
+ # Composite Long-Task Workflow Protocol
2
+
3
+ ## Expected Runtime Effect / 预期实现效果
4
+
5
+ `composite-long-task-workflow` is Tiny Context's Superpowers-backed composite long-task workflow Skill. It is not the Tiny Context Workflow Contract itself and is not an ordinary target-mode prompt generator. Its job is to combine three upstream authority inputs, Tiny Context workflow rules, project Context, official Superpowers execution methods, canonical task state and acceptance evidence into a recoverable, auditable Codex Goal workflow whose completion can be computed.
6
+
7
+ The workflow prevents long-running implementation drift across many turns, agents, slices, validators and context compactions: product-intent drift, missing Context updates, scope shrinkage, plan/implementation mismatch, incomplete AC evidence, sampled proof pretending to be full population, passing tests pretending to be acceptance, and audit completion pretending to be product completion.
8
+
9
+ ## Execution Order
10
+
11
+ The fusion order is fixed:
12
+
13
+ ```text
14
+ Tiny Context Workflow Contract
15
+ -> confirm three-input source authority
16
+ -> compile task-state.json
17
+ -> enter Superpowers implementation slices
18
+ -> each slice updates canonical state and evidence
19
+ -> derive local audit / matrix / verdict / progress / evidence views
20
+ -> run gates
21
+ -> final-gate computes product_goal_complete
22
+ ```
23
+
24
+ ## Workflow Identity
25
+
26
+ This protocol is the detailed execution contract for `composite-long-task-workflow`: a Tiny Context-owned composite workflow adapter for Superpowers-backed long-task execution. It is not the Tiny Context Workflow Contract itself, not a durable project Context file, not a business fact source, not a normal target-mode prompt generator and not an official Superpowers fork.
27
+
28
+ ## Authority Model
29
+
30
+ Authority is fixed before implementation starts: Product / Architecture Source owns intent, scope and boundaries; Technical Realization Plan owns PI implementation and plan conformance; Acceptance Checklist owns AC completion semantics and proof layers; `task-state.json` is the only execution state source; `events.ndjson` is append-only; `derived/**` is generated reading output only.
31
+
32
+ ## Slice Protocol
33
+
34
+ Implementation advances through coherent slices. Each slice selects related PI / AC / proof-layer gaps, performs implementation and verification work, records canonical evidence, writes and applies `slice-delta.json`, derives views and runs slice-gate. Shared provider/browser/runtime/security proof environments use epoch-gate instead of repeating the full final gate after every slice.
35
+
36
+ ## Evidence Protocol
37
+
38
+ Evidence is canonical state, not prose. Every proof record enters `task-state.evidence[]` with evidence id, slice id, type, command or artifact paths, command exit code when applicable, `proves`, `does_not_prove`, freshness, redaction, reviewability / reproduction data and, for machine-verifiable layers, an `assertion_result`. Evidence must be fresh, reviewable and free of secrets, raw credentials, tokens, cookies and long raw payloads.
39
+
40
+ Machine-verifiable layers such as `ui_browser`, `api_schema`, `runtime`, `worker_runtime`, `data_artifact`, `integration`, `security_redaction`, `test`, `all_provider_all_runner` and `cleanup_stale_scan` are not complete from descriptions, screenshots, final cards, validator passes, matrix rows or verdict rows. They require `assertion_result.schema_version=assertion-result-v1`, `assertion_result.status=passed`, assertion exit code `0`, command exit code `0` when present, target AC/layer coverage, passed positive and negative assertions and reviewable artifacts. UI/browser layers also require owner surface, route/path, user action, browser/playwright/UI assertion evidence and a passed `negative_evidence_scan`.
41
+
42
+ ## Derived Views
43
+
44
+ `derived/**` contains generated reading views only: local audit, plan-conformance matrix, final acceptance verdict, progress ledger, evidence index, context alignment and final summary. Matrix and verdict views may summarize `assertion_status`, blocking assertion failures and negative evidence findings, but they never replace assertion execution and never rewrite Product / Architecture Source, Technical Realization Plan, Acceptance Checklist or `task-state.json`.
45
+
46
+ ## Gates
47
+
48
+ The runtime gate sequence is slice-gate for one slice, epoch-gate for shared proof environments and final-gate for product completion. Plan conformance is judged against the Technical Realization Plan, acceptance evidence is judged against the Acceptance Checklist, and final-gate is the only path that computes `product_goal_complete`.
49
+
50
+ ## Required Bootstrap
51
+
52
+ Every executor first reads `execution-binding.md`, `workflow-protocol.md`, the three input files, `task-state.json` and current `derived/**` views. If state is missing or stale, initialize or compile through `ty-context composite-long-task init <workdir>` and `ty-context composite-long-task compile <workdir>` before choosing the next implementation slice.
53
+
54
+ ## Tiny Context Contract Layer
55
+
56
+ The workflow uses Context Priority Ladder, Context Delta, Source-to-Context Coverage, Context-to-Implementation Binding, Contract Conformance and Context drift check as the durable-fact and implementation-binding layer. These rules constrain the composite workflow, but the composite workflow does not replace or register itself as the Tiny Context Workflow Contract.
57
+
58
+ ## Superpowers Execution Binding
59
+
60
+ Superpowers remains the execution layer: prefer `superpowers:subagent-driven-development` when subagents are available, use `superpowers:executing-plans` otherwise, use `superpowers:test-driven-development` for behavior gaps and run `superpowers:verification-before-completion` before completion claims. Tiny Context may wrap Superpowers with authority, conformance and acceptance gates, but must not redefine, duplicate or fork official Superpowers mechanics.
61
+
62
+ ## Final Gate Protocol
63
+
64
+ Final completion always runs in fixed order: derive all views, run `superpowers:verification-before-completion`, validate canonical state, validate plan acceptance artifacts, run auditor and stale-overclaim checks when applicable, rederive/revalidate if fixes changed state or evidence, then let `ty-context composite-long-task final-gate <workdir>` compute `product_goal_complete`.
65
+
66
+ ## Completion State Machine
67
+
68
+ `audit_task_complete` means the workflow or audit pass finished. `acceptance_target_status` is the acceptance verdict. `product_goal_complete` is computed only by final-gate and is the only implementation/execution Goal completion condition. A read-only audit goal may finish at audit completion only while saying `Audit workflow completed; acceptance target not complete.` for non-accepted targets.
69
+
70
+ ## Forbidden Shortcuts
71
+
72
+ Tests alone do not prove plan conformance. Superpowers review does not prove AC acceptance. Sample evidence does not prove full population unless the AC allows it. Browser screenshots, final cards, validator passes, matrix/verdict rows and prose evidence are auxiliary only for machine-verifiable ACs unless a passed assertion report is bound to the target AC/layer. Derived files, local audit, validator output and auditor reports cannot rewrite Product / Plan / Checklist. Local audit cannot mark product completion. Agents must not handwrite `product_goal_complete`.
73
+
74
+ ## Hallucination Guard
75
+
76
+ The protocol must prevent false fusion: do not interpret the composite workflow as the Tiny Context Workflow Contract itself; do not register `workflow-protocol.md` in `project_context/context.toml`; do not treat it as a business fact source; do not use local audit, tests, Superpowers review, sampled evidence, screenshots, final cards, matrix/verdict rows, validator passes or final-gate failure as product completion; do not claim full alignment with unresolved Source-to-Context Coverage or Context-to-Implementation Binding gaps; and do not call a Codex implementation Goal complete before final-gate passes.
77
+
78
+ ## Blocker Protocol
79
+
80
+ Maximize autonomous progress with repository tools, local app/browser sessions, CLI auth, credential helpers and authorized elevation. Stop only for locally unsatisfiable blockers such as MFA, missing permission, unavailable credentials, external approval or legal/system limits, and return the minimal user action list plus the next agent step.
81
+
82
+ ## 1. Materials Entering Agent Context
83
+
84
+ The executor must see and fuse these materials together:
85
+
86
+ ```text
87
+ 1. Tiny Context Workflow Contract
88
+ - Context Priority Ladder
89
+ - Context Delta
90
+ - Source-to-Context Coverage
91
+ - Context-to-Implementation Binding
92
+ - Contract Conformance
93
+ - Context drift check
94
+
95
+ 2. Project durable Context
96
+ - project_context/global.md
97
+ - project_context/architecture.md
98
+ - project_context/context.toml
99
+ - matching project_context/areas/**/*
100
+ - DESIGN.md when applicable
101
+
102
+ 3. Three long-task authority inputs
103
+ - Product / Architecture Source
104
+ - Technical Realization Plan
105
+ - Acceptance Checklist
106
+
107
+ 4. Composite workflow protocol artifacts
108
+ - workflow-protocol.md
109
+ - execution-binding.md
110
+ - goal-objective.txt
111
+
112
+ 5. Official Superpowers execution layer
113
+ - superpowers:subagent-driven-development
114
+ - superpowers:executing-plans
115
+ - superpowers:test-driven-development
116
+ - superpowers:verification-before-completion
117
+
118
+ 6. State and audit kernel
119
+ - task-state.json
120
+ - events.ndjson
121
+ - derived/**
122
+ - task-state.evidence[]
123
+ - slice / epoch / final gates
124
+ ```
125
+
126
+ The fusion order is not free-form. The executor first applies the Tiny Context Workflow Contract, then confirms the three-input source authority, then compiles state, then uses Superpowers implementation slices, then updates canonical state/evidence, derives reading views, runs gates and lets final-gate compute completion.
127
+
128
+ ## 2. Phase One: Workflow Contract First
129
+
130
+ After receiving a Goal, the executor must not start with code. It first applies Tiny Context workflow rules:
131
+
132
+ ```text
133
+ 1. Read project_context/global.md, architecture.md, context.toml and relevant area/role Context.
134
+ 2. Decide Product Context Delta and Technical Context Delta.
135
+ 3. If either is required, update the smallest owning Context before implementation.
136
+ 4. Build Source-to-Context Coverage for the three inputs:
137
+ - whether each source item is covered by existing Context;
138
+ - whether Context must be added or updated;
139
+ - whether it is task-local only;
140
+ - whether it is explicitly out of scope;
141
+ - whether a user decision is needed.
142
+ 5. For high-risk implementation, build Context-to-Implementation Binding:
143
+ - which surfaces each Context fact must reach;
144
+ - expected implementation paths;
145
+ - forbidden shortcuts;
146
+ - verification paths.
147
+ ```
148
+
149
+ This phase answers whether the task changes durable facts, whether Context supports implementation, which product/architecture/API/schema/state/surface/verification facts must be written first, and which concrete paths and verification entries the implementation must bind to.
150
+
151
+ If Source-to-Context Coverage still has `new_context_required`, `under_scoped` or `needs_user_decision`, do not claim the plan was fully implemented. If Context-to-Implementation Binding still has `missing`, `partial`, `blocked` or `contradicted_by_current_state`, do not claim Context-to-code alignment.
152
+
153
+ ## 3. Phase Two: Three Inputs Lock Task Authority
154
+
155
+ The authority relationship is fixed:
156
+
157
+ ```text
158
+ Product / Architecture Source
159
+ = intent, scope, boundaries, owner surface, delivery scope, full population / sample semantics.
160
+
161
+ Technical Realization Plan
162
+ = PI items, implementation paths, API/schema, state machine, worker/runtime, UI/IA, required tests, plan conformance.
163
+
164
+ Acceptance Checklist
165
+ = AC items, completion semantics, required proof layers, invalid evidence, fail conditions, acceptance verdict.
166
+ ```
167
+
168
+ `task-state.json` is compiled from these inputs. `derived/**`, local audit, matrix, verdict, validator output and auditor reports cannot rewrite them. Project Context also preserves this authority model: source owns intent/scope/boundaries, plan owns executable blueprint and plan conformance, checklist owns AC completion semantics and proof layers.
169
+
170
+ ## 4. Phase Three: Compile The State Kernel
171
+
172
+ When initializing or resuming a task, the executor confirms this workdir shape:
173
+
174
+ ```text
175
+ tmp/ty-context/plan-acceptance/<plan-slug>/
176
+ product-architecture-source.md
177
+ technical-realization-plan.md
178
+ acceptance-checklist.md
179
+ workflow-protocol.md
180
+ execution-binding.md
181
+ task-state.json
182
+ events.ndjson
183
+ derived/**
184
+ ```
185
+
186
+ If `task-state.json` is absent or uncompiled, use the public command path:
187
+
188
+ ```bash
189
+ ty-context composite-long-task init <workdir>
190
+ ty-context composite-long-task compile <workdir>
191
+ ```
192
+
193
+ Legacy/internal compatibility may exist as an equivalent implementation namespace only:
194
+
195
+ ```bash
196
+ ty-context superpowers init <workdir>
197
+ ty-context superpowers compile <workdir>
198
+ ```
199
+
200
+ The compiled state forms:
201
+
202
+ ```text
203
+ Plan graph:
204
+ PI -> AC
205
+ AC -> required proof layers
206
+ delivery scope
207
+ sample / full population boundary
208
+ owner surfaces
209
+ forbidden shortcuts
210
+
211
+ State kernel:
212
+ task-state.json = only execution state source
213
+ events.ndjson = append-only event log
214
+ derived/** = generated reading views only
215
+ ```
216
+
217
+ The goal of this phase is to turn natural-language plans into a state-machine-traceable task graph.
218
+
219
+ ## 5. Phase Four: Superpowers Enters Implementation
220
+
221
+ Superpowers organizes implementation execution:
222
+
223
+ ```text
224
+ - Prefer superpowers:subagent-driven-development when subagents are available.
225
+ - Use superpowers:executing-plans when subagents are unavailable or insufficient.
226
+ - Use superpowers:test-driven-development for behavior changes.
227
+ - Use superpowers:verification-before-completion before any completion claim.
228
+ ```
229
+
230
+ Tiny Context does not copy, fork or override official Superpowers execution mechanics. It wraps them with:
231
+
232
+ ```text
233
+ source authority gate
234
+ plan conformance gate
235
+ acceptance evidence gate
236
+ state consistency gate
237
+ final completion gate
238
+ ```
239
+
240
+ Superpowers manages how to move implementation forward efficiently. Tiny Context checks whether implementation drifted from the source, plan and ACs.
241
+
242
+ ## 6. Phase Five: What An Implementation Slice Is
243
+
244
+ An implementation slice is not an arbitrary file chunk, page chunk or API chunk. It is the smallest coherent execution unit that closes related gaps.
245
+
246
+ A slice should:
247
+
248
+ ```text
249
+ 1. Bind 2-4 strongly related missing layers.
250
+ 2. Usually share one or more of:
251
+ - same AC;
252
+ - same PI;
253
+ - same runtime scenario;
254
+ - same owner surface;
255
+ - same proof environment;
256
+ - same verification path group.
257
+ 3. Advance both implementation and evidence.
258
+ 4. End by updating task-state and reducing explicit plan/AC/proof gaps.
259
+ ```
260
+
261
+ A slice usually:
262
+
263
+ ```text
264
+ - modifies implementation code;
265
+ - modifies API/schema/state/worker/runtime/UI/IA when required;
266
+ - runs required tests or smoke checks;
267
+ - captures evidence;
268
+ - writes slice-delta.json;
269
+ - applies the slice delta;
270
+ - derives views;
271
+ - runs slice-gate.
272
+ ```
273
+
274
+ A slice cannot only say "some work was done." Its `progress_value` must explain which gap it closed and why that reduces later rework.
275
+
276
+ ## 7. Phase Six: Slice Delta Updates State
277
+
278
+ After every slice, progress must enter `task-state.json` through structured state update. Do not handwrite derived results and do not report progress only in chat.
279
+
280
+ `slice-delta.json` must express at least:
281
+
282
+ ```text
283
+ slice_id
284
+ slice_goal
285
+ touched_plan_items
286
+ touched_acs
287
+ code_changes
288
+ evidence_records
289
+ closed_layers
290
+ remaining_layers
291
+ blockers
292
+ cleanup_assertions
293
+ progress_value
294
+ ```
295
+
296
+ Each evidence record enters `task-state.evidence[]` and includes:
297
+
298
+ ```text
299
+ evidence_id
300
+ slice_id
301
+ type
302
+ command
303
+ artifact_paths
304
+ proves
305
+ does_not_prove
306
+ freshness
307
+ redaction
308
+ reviewability / reproduction_steps
309
+ ```
310
+
311
+ `proves` and `does_not_prove` are both required because evidence must say what it proves and what it does not prove. This prevents samples, passing tests, screenshots, mocks or local audit text from being reused as full acceptance.
312
+
313
+ ## 8. Phase Seven: Local Audit And Derived Views
314
+
315
+ After state changes, run:
316
+
317
+ ```bash
318
+ ty-context composite-long-task derive <workdir>
319
+ ```
320
+
321
+ Legacy/internal compatibility may exist as:
322
+
323
+ ```bash
324
+ ty-context superpowers derive <workdir>
325
+ ```
326
+
327
+ The generated views are:
328
+
329
+ ```text
330
+ derived/local-audit.md
331
+ derived/plan-conformance-matrix.md
332
+ derived/final-acceptance-verdict.md
333
+ derived/progress-ledger.md
334
+ derived/evidence-index.md
335
+ derived/context-alignment.md
336
+ derived/final-summary.md
337
+ ```
338
+
339
+ Their roles:
340
+
341
+ ```text
342
+ local-audit.md
343
+ = recovery view for future sessions or subagents.
344
+
345
+ plan-conformance-matrix.md
346
+ = whether PIs were implemented, whether evidence maps correctly, and whether implementation drifted from the Technical Plan.
347
+
348
+ final-acceptance-verdict.md
349
+ = whether ACs satisfy required proof layers, what is missing, and what cannot be accepted.
350
+
351
+ progress-ledger.md
352
+ = separate progress for AC acceptance, engineering implementation, runtime/proof, system capability, sample, real object, full population and workflow overhead.
353
+
354
+ evidence-index.md
355
+ = index from evidence_id to proved object, artifact, command and does_not_prove boundary.
356
+
357
+ context-alignment.md
358
+ = alignment state for Context Delta, Source-to-Context Coverage and Context-to-Implementation Binding.
359
+
360
+ final-summary.md
361
+ = whether completion is currently possible, why not, and what comes next.
362
+ ```
363
+
364
+ All `derived/**` files are generated views, not authority. They must not be hand-edited as completion evidence. Local audit is not Context, not quality proof and not a global task manager; it is only a recovery and audit view.
365
+
366
+ ## 9. Phase Eight: Slice Gate And Epoch Gate
367
+
368
+ After each slice, run:
369
+
370
+ ```bash
371
+ ty-context composite-long-task slice-gate <workdir> --slice <slice-id>
372
+ ```
373
+
374
+ Slice gate checks:
375
+
376
+ ```text
377
+ - whether the slice closed a real PI/AC/proof-layer gap;
378
+ - whether fresh reviewable evidence exists;
379
+ - whether required machine-verifiable proof layers have passed assertion results;
380
+ - whether negative evidence findings invalidate the layer or AC;
381
+ - whether evidence entered task-state.evidence[];
382
+ - whether closed_layers are actually proved;
383
+ - whether remaining_layers were not falsely closed;
384
+ - whether blockers are recorded truthfully;
385
+ - whether derived views match task-state.
386
+ ```
387
+
388
+ When multiple slices reuse one provider/browser/runtime/security proof environment, run:
389
+
390
+ ```bash
391
+ ty-context composite-long-task epoch-gate <workdir> --epoch <epoch-id>
392
+ ```
393
+
394
+ Epoch gate validates the shared proof environment in batch, avoids running full final gate after every slice, and prevents shared runtime/browser/provider evidence from being reused after contamination or staleness.
395
+
396
+ ## 10. Phase Nine: Plan Conformance Gate
397
+
398
+ Plan conformance is judged by the Technical Realization Plan, not by the executor's summary.
399
+
400
+ Each PI answers:
401
+
402
+ ```text
403
+ - Was the PI actually implemented?
404
+ - Do implementation paths match implementation_paths?
405
+ - Are owner_surfaces correct?
406
+ - Were forbidden_surfaces avoided?
407
+ - Did API/schema/state/runtime/data/UI/IA land according to the Plan?
408
+ - Were required_tests executed or blocked with reason?
409
+ - Can related_acs be traced through evidence?
410
+ ```
411
+
412
+ `derived/plan-conformance-matrix.md` is only a view. The authoritative state is `task-state.json` plus evidence records.
413
+
414
+ Forbidden substitutions:
415
+
416
+ ```text
417
+ - "code changed" does not prove plan conformance;
418
+ - "tests passed" does not prove PI completion;
419
+ - "Superpowers review passed" does not prove Plan Conformance Gate;
420
+ - convenient current-code paths do not override the Technical Realization Plan.
421
+ ```
422
+
423
+ ## 11. Phase Ten: Acceptance Evidence Gate
424
+
425
+ AC completion is decided by the Acceptance Checklist. Every AC must satisfy its declared `required_proof_layers`.
426
+
427
+ Proof layers may include:
428
+
429
+ ```text
430
+ code
431
+ api_schema
432
+ worker_runtime
433
+ data_artifact
434
+ ui_browser
435
+ security_redaction
436
+ all_provider_all_runner
437
+ cleanup_stale_scan
438
+ test
439
+ ```
440
+
441
+ AC completion requires:
442
+
443
+ ```text
444
+ 1. Every required proof layer has fresh reviewable evidence.
445
+ 2. evidence.proves explicitly covers that layer.
446
+ 3. evidence.does_not_prove does not expose a scope substitution problem.
447
+ 4. Machine-verifiable required layers have assertion_result.status=passed and exit code 0.
448
+ 5. Positive and negative assertions passed for the target AC/layer.
449
+ 6. Negative evidence scan has no forbidden owner-surface state.
450
+ 7. No missing required layers.
451
+ 8. No material drift.
452
+ 9. No stale artifact.
453
+ 10. No raw secret/token/cookie/payload leak.
454
+ 11. No sibling surface / sample object / mock substitution for owner surface or full population.
455
+ 12. When full_population_required=true, sample evidence cannot replace full-population evidence.
456
+ ```
457
+
458
+ This gate enables an external reviewer to follow the evidence chain. Auditor subagents may find gaps but are not proof sources.
459
+
460
+ Invalid evidence for UI/browser AC completion includes screenshot-only proof, component screenshots, storybook pages, viewmodels, mocks, unit-only proof, API-only proof, diagnostic pages, final cards, matrix/verdict rows, validator passes and prose summaries. Forbidden final owner-surface states such as `未验证`, `不可用`, `暂不可用` or `页面无明显变化` invalidate the relevant AC/layer.
461
+
462
+ ## 12. Phase Eleven: Delivery Scope And Full Population Stay Separate
463
+
464
+ The workflow always distinguishes:
465
+
466
+ ```text
467
+ system_capability_build
468
+ representative_sample_validation
469
+ full_population_operation
470
+ mixed_scope_requires_boundary
471
+ out_of_scope_backlog
472
+ ```
473
+
474
+ Typical forbidden claims:
475
+
476
+ ```text
477
+ - framework complete does not mean all real objects complete;
478
+ - several objects succeeded does not mean automation capability complete;
479
+ - sample provider succeeded does not mean all-provider complete;
480
+ - UI screenshot exists does not mean owner surface primary path is closed;
481
+ - final card, matrix, verdict or validator pass does not mean a machine-verifiable AC has assertion-backed evidence;
482
+ - tests passed does not mean AC accepted;
483
+ - local audit passed does not mean product_goal_complete.
484
+ ```
485
+
486
+ If Product / Plan / Checklist disagree on delivery scope, state records:
487
+
488
+ ```text
489
+ scope_conflict_requires_decision
490
+ ```
491
+
492
+ Completion is blocked until the source conflict is resolved. Validators inspect explicit fields; they do not infer business scope from prose.
493
+
494
+ ## 13. Phase Twelve: Fixed Final Gate Order
495
+
496
+ Before final completion, the order is fixed:
497
+
498
+ ```text
499
+ 1. derive all views
500
+ 2. superpowers:verification-before-completion
501
+ 3. ty-context validate-superpowers-state <workdir>
502
+ 4. ty-context validate-plan-acceptance <workdir>
503
+ 5. read-only auditor / stale-overclaim scan when applicable
504
+ 6. if auditor findings changed state/evidence, derive and validate again
505
+ 7. AC Evidence Assertion Gate and Negative Evidence Scan Gate
506
+ 8. ty-context composite-long-task final-gate <workdir>
507
+ ```
508
+
509
+ Legacy/internal compatibility may exist as:
510
+
511
+ ```text
512
+ ty-context superpowers final-gate <workdir>
513
+ ```
514
+
515
+ Only final-gate computes:
516
+
517
+ ```text
518
+ product_goal_complete=true
519
+ ```
520
+
521
+ Implementation / execution Goals complete only after that computed state.
522
+
523
+ ## 14. Completion Semantics
524
+
525
+ The workflow distinguishes:
526
+
527
+ ```text
528
+ audit_task_complete
529
+ = whether the audit/reporting task finished.
530
+
531
+ acceptance_target_status
532
+ = AC acceptance target state.
533
+
534
+ product_goal_complete
535
+ = whether implementation/execution is truly complete.
536
+ ```
537
+
538
+ Rules:
539
+
540
+ ```text
541
+ 1. Do not handwrite product_goal_complete.
542
+ 2. product_goal_complete is computed only by final-gate.
543
+ 3. audit_task_complete=true is not product completion.
544
+ 4. If acceptance_target_status is not complete, do not say Goal achieved.
545
+ 5. A read-only audit task may end, but must say:
546
+ Audit workflow completed; acceptance target not complete.
547
+ 6. Implementation / execution Goal mode can call update_goal complete only when product_goal_complete=true.
548
+ ```
549
+
550
+ This must stay visible in Skill and Goal objective because Codex Goal mode can otherwise confuse "audit workflow ended" with "product target accepted."
551
+
552
+ ## 15. Blocker Strategy
553
+
554
+ The executor maximizes autonomous progress:
555
+
556
+ ```text
557
+ - reuse local app login sessions;
558
+ - reuse browser sessions;
559
+ - reuse CLI auth;
560
+ - reuse OS credential helpers;
561
+ - try authorized sudo / gsudo / administrator elevation first;
562
+ - solve locally discoverable command/page/script/config/test/log issues before pausing.
563
+ ```
564
+
565
+ Only these are user blockers:
566
+
567
+ ```text
568
+ - MFA;
569
+ - account not logged in and cannot self-service login;
570
+ - insufficient permissions;
571
+ - external approval;
572
+ - payment or paid-source authorization;
573
+ - platform policy or legal restriction;
574
+ - credentials or decisions that only the user can supply.
575
+ ```
576
+
577
+ When reporting a blocker, include the minimal user action:
578
+
579
+ ```text
580
+ - exact page/system/command to open;
581
+ - exact field or value location;
582
+ - sensitive values not to send;
583
+ - what the agent will do next;
584
+ - why completion is currently impossible.
585
+ ```
586
+
587
+ ## 16. Final Expected Effect
588
+
589
+ The result is a recoverable long-running loop:
590
+
591
+ ```text
592
+ Tiny Context Workflow Contract
593
+ -> Context Delta
594
+ -> Context update or confirmation
595
+ -> Source-to-Context Coverage
596
+ -> Context-to-Implementation Binding
597
+
598
+ Three inputs
599
+ -> lock product intent, technical plan and acceptance semantics
600
+ -> compile PI/AC/proof graph
601
+
602
+ Superpowers
603
+ -> implementation slices
604
+ -> multi-agent / TDD / executing-plans implementation
605
+
606
+ Each slice
607
+ -> code/API/runtime/UI changes
608
+ -> evidence capture
609
+ -> slice-delta update
610
+ -> apply-slice-delta
611
+ -> derive audit / matrix / verdict / progress / evidence views
612
+ -> slice-gate / epoch-gate
613
+
614
+ Final
615
+ -> Plan Conformance Gate
616
+ -> Acceptance Evidence Gate
617
+ -> External Reviewer / stale-overclaim scan
618
+ -> final-gate
619
+ -> product_goal_complete=true before Codex Goal completion
620
+ ```
621
+
622
+ One-sentence definition:
623
+
624
+ ```text
625
+ The expected runtime effect of the composite long-task workflow is to make a Codex agent fuse Tiny Context fact/process constraints, three upstream task authorities, Superpowers long-task execution and a task-state evidence state machine in one context; execution goes Context first, then Plan, then Superpowers slices, and completion is judged by state-backed gates for plan conformance, AC evidence and product_goal_complete so long tasks do not drift in implementation, acceptance or completion claims.
626
+ ```
627
+
628
+ ## 17. Forbidden Wrong Fusion / 不允许的错误融合
629
+
630
+ The workflow must explicitly prevent these interpretations:
631
+
632
+ ```text
633
+ Do not interpret the composite long-task workflow as the Tiny Context Workflow Contract itself.
634
+ Do not register workflow-protocol.md in project_context/context.toml.
635
+ Do not treat workflow-protocol.md as a business fact source.
636
+ Do not let derived/** rewrite Product / Plan / Checklist.
637
+ Do not treat local audit as quality proof.
638
+ Do not treat Superpowers review as plan conformance or AC acceptance.
639
+ Do not treat sample evidence as full-population proof.
640
+ Do not claim full implementation when Context Delta is required but Context is not updated.
641
+ Do not claim full alignment while Source-to-Context Coverage / Context-to-Implementation Binding has unresolved gaps.
642
+ Do not handwrite product_goal_complete.
643
+ Do not call update_goal complete before final-gate passes.
644
+ ```