project-tiny-context-harness 0.2.76 → 0.2.78
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/README.md +7 -5
- package/assets/README.md +7 -5
- package/assets/README.zh-CN.md +3 -1
- package/assets/skills/context_development_engineer/SKILL.md +44 -42
- package/assets/skills/superpowers-long-task/SKILL.md +35 -19
- package/dist/lib/superpowers-task-compile.d.ts +3 -1
- package/dist/lib/superpowers-task-compile.js +110 -1
- package/dist/lib/superpowers-task-delivery.d.ts +4 -0
- package/dist/lib/superpowers-task-delivery.js +84 -0
- package/dist/lib/superpowers-task-derive.js +12 -0
- package/dist/lib/superpowers-task-state-schema.d.ts +37 -2
- package/dist/lib/superpowers-task-state-schema.js +2 -1
- package/dist/lib/superpowers-task-state.d.ts +1 -0
- package/dist/lib/superpowers-task-state.js +19 -1
- package/dist/lib/superpowers-task-validator.js +15 -1
- package/package.json +69 -69
package/README.md
CHANGED
|
@@ -96,9 +96,11 @@ The ordinary long-task path uses `/normal-long-task`. It is the non-Superpowers
|
|
|
96
96
|
|
|
97
97
|
The Superpowers long-task path uses `/superpowers-long-task` when three inputs already exist: `Product / Architecture Source`, `Technical Realization Plan` and `Acceptance Checklist`. The product/architecture source preserves original intent and scope; the technical realization plan is the execution blueprint and plan-conformance source; the checklist is the acceptance authority. The Skill does not perform complexity routing: invocation means Superpowers long-task execution was already selected. Two-document compatibility is allowed only when the first document clearly contains both product/architecture source and technical realization plan sections. If only a product/architecture source and checklist exist, the Skill stops with a Missing Fields Report for a missing `Technical Realization Plan` instead of generating one. The technical realization plan must already satisfy the required Superpowers-ready Markdown implementation plan fields; if it does, the prompt binds it directly to Superpowers execution rather than regenerating the plan, and if it does not, the Skill stops before generating a prompt. The prompt is Tiny Context's adapter layer, aligned to the official Superpowers skills while remaining a Tiny Context-owned adapter rather than an upstream-owned schema. It may wrap Superpowers with Tiny Context authority, conformance and acceptance gates, but it must not redefine or fork Superpowers execution mechanics. It requires parent-level `Product Context Delta` and `Technical Context Delta` checks before implementation and uses a canonical state kernel under `tmp/ty-context/plan-acceptance/<plan-slug>/`: `task-state.json` is the only execution state source, `events.ndjson` is append-only and `derived/**` contains generated local audit, plan-conformance matrix, final acceptance verdict, progress ledger, evidence index, context alignment and final summary views. Complete acceptance rows are externally reviewable evidence claims derived from `task-state.evidence[]`: the checklist supplies the proof chain, fresh reviewable evidence must satisfy every required layer, and material drift, missing layers or unapproved sibling substitution prevent `complete`. Goal-mode wording separates `audit_task_complete`, `acceptance_target_status` and computed `product_goal_complete`: implementation / execution goals complete only when `ty-context superpowers final-gate` computes `product_goal_complete=true`; read-only audit goals may end at `audit_task_complete`, but a non-accepted verdict says `Audit workflow completed; acceptance target not complete.` and does not use unqualified `Goal achieved` or `update_goal(status="complete")` as acceptance of the user target.
|
|
98
98
|
|
|
99
|
+
The three inputs also carry capability-first delivery boundaries. Product / Architecture Source declares `delivery_scope`, `full_population_required`, samples that validate the claim, samples that do not validate it and out-of-scope backlog. Each Technical Realization Plan item declares delivery scope, capability target, representative samples, full-population boundary and non-required population. Each Acceptance Checklist item declares acceptance scope, what it validates and does not validate, sample boundary and full-population requirement. `scope_conflict_requires_decision` blocks completion when source, plan and checklist disagree between system capability build, representative sample validation and full-population operation. Sample evidence or framework-only implementation cannot prove all-provider, all-interface, all-platform or full-population completion unless the AC explicitly allows it; when full population is not explicitly required, generated views report it as `not_in_scope`.
|
|
100
|
+
|
|
99
101
|
For non-trivial Superpowers slices, the generated prompt requires a structured `slice-delta.json`. The executor applies it with `ty-context superpowers apply-slice-delta <workdir> <slice-delta.json>`, then runs `ty-context superpowers derive` and `ty-context superpowers slice-gate`. Each delta records touched plan items/ACs, code changes, closed and remaining proof layers, blockers, cleanup assertions, `progress_value` and canonical evidence records with `proves`, `does_not_prove`, freshness, redaction and reviewability. Default slice guidance is to group 2-4 strongly related missing layers that share an AC, runtime scenario, proof environment or verification path, while single-gap slices are reserved for blockers, contradictions or small metadata cleanup. The prompt also asks executors to classify missing layers, reuse DB/API/Browser environments only with unique proof prefixes and cleanup assertions, and run a stale/overclaim scan after deriving artifacts.
|
|
100
102
|
|
|
101
|
-
The generated Superpowers prompt uses Slice Gate / Epoch Gate / Final Gate cadence instead of running a full final gate after every slice. Progress Accounting tracks AC acceptance completion, engineering implementation progress, runtime/proof progress, artifact budget, proof-layer milestone status and workflow overhead in state and generated `derived/progress-ledger.*`. Workflow overhead backpressure asks executors to batch shared provider/browser/runtime/security epoch proof environments, prune stale artifacts and choose the Next 3-5 high-value clusters that close the most blocking AC/proof-layer gaps.
|
|
103
|
+
The generated Superpowers prompt uses Slice Gate / Epoch Gate / Final Gate cadence instead of running a full final gate after every slice. Progress Accounting tracks AC acceptance completion, engineering implementation progress, runtime/proof progress, system capability progress, representative sample progress, real object coverage, full population operation progress, artifact budget, proof-layer milestone status and workflow overhead in state and generated `derived/progress-ledger.*`. Workflow overhead backpressure asks executors to batch shared provider/browser/runtime/security epoch proof environments, prune stale artifacts and choose the Next 3-5 high-value clusters that close the most blocking AC/proof-layer gaps.
|
|
102
104
|
|
|
103
105
|
The recommended Superpowers layer is the specific [obra/Superpowers](https://github.com/obra/superpowers) plugin/workflow, not a generic planning substitute. After `/superpowers-long-task` accepts the input packet, prefer `superpowers:subagent-driven-development` when subagents are available and `superpowers:executing-plans` otherwise. Behavior changes should use `superpowers:test-driven-development`. Final gate order is derive all views, `superpowers:verification-before-completion`, `ty-context validate-superpowers-state <dir>`, `ty-context validate-plan-acceptance <dir>`, read-only auditor when available, rederive/revalidate if auditor fixes changed state or evidence, final stale/overclaim scan, then `ty-context superpowers final-gate <dir>` computes completion. The auditor reconstructs AC proof chains with a fixed auditor checklist and finds gaps, but does not become proof. Superpowers review and verification remain useful execution checks, but they cannot override Tiny Context gates: passing Superpowers review does not by itself prove plan conformance or checklist acceptance.
|
|
104
106
|
|
|
@@ -157,7 +159,7 @@ npm ci
|
|
|
157
159
|
npm run smoke:quickstart
|
|
158
160
|
npm run preview:pack
|
|
159
161
|
cd /path/to/your/test-repo
|
|
160
|
-
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.2.
|
|
162
|
+
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.2.78.tgz
|
|
161
163
|
npx --no-install ty-context init --adopt
|
|
162
164
|
make validate-context
|
|
163
165
|
```
|
|
@@ -272,7 +274,7 @@ Use `npx --no-install ty-context ...` only when you explicitly want the already
|
|
|
272
274
|
| Full project context export Skill | `<harnessRoot>/skills/context_full_project_export/SKILL.md` | Handles explicit full-project, project-overall, Source Pack or code-level export requests and uses `export-context --source-pack`, `--code-index`, `--task-context`, `--all`, `--full` or `--code` to create temporary artifacts under `tmp/ty-context/context-exports/**`. |
|
|
273
275
|
| Harness upgrade Skill | `<harnessRoot>/skills/context_harness_upgrade/SKILL.md` | Handles explicit Tiny Context / Project Tiny Context Harness upgrade requests such as “upgrade Tiny Context” and “use the Tiny Context upgrade skill to upgrade this project”; it runs the canonical `upgrade` path, handles only migration-scoped `manual_required` / `blocked` follow-up, then runs diagnostics. |
|
|
274
276
|
| Ordinary long-task Skill | `<harnessRoot>/skills/normal-long-task/SKILL.md` | Invoke as `/normal-long-task` to turn a referenced plan, RFC, implementation proposal or two-document upstream input into a falsifiable acceptance checklist and optional generic paste-ready goal/target-mode prompt under `tmp/ty-context/plan-acceptance/**`; if the plan already contains an explicit concrete checklist, the Skill reuses it verbatim in the separate full-checklist file; compact summaries are only navigation/priority, but the Skill does not execute the plan or prove completion. |
|
|
275
|
-
| Superpowers long-task Skill | `<harnessRoot>/skills/superpowers-long-task/SKILL.md` | Invoke as `/superpowers-long-task` when Product / Architecture Source, Technical Realization Plan and Acceptance Checklist exist and Superpowers execution is needed. It emits a Superpowers-specific prompt with Context Delta checks
|
|
277
|
+
| Superpowers long-task Skill | `<harnessRoot>/skills/superpowers-long-task/SKILL.md` | Invoke as `/superpowers-long-task` when Product / Architecture Source, Technical Realization Plan and Acceptance Checklist exist and Superpowers execution is needed. It emits a Superpowers-specific prompt with Context Delta checks, official workflow skill names, capability-first delivery scope fields, plan-conformance matrix, final acceptance verdict and externally reviewable evidence discipline, and stops when required input fields are missing. It does not generate the technical plan, checklist or execute the plan. |
|
|
276
278
|
| Project-local Skills | `<harnessRoot>/skills/<role>/SKILL.md` | Optional local product/design/development Skills created by the project, such as `product_plan`, `uiux_design` or `development_engineer`. They supersede package-managed default Skills when more specific, are not overwritten by `sync`, and should keep front matter trigger keywords aligned with the project `AGENTS.md` role-trigger rule. |
|
|
277
279
|
| Managed file sync | `make ty-context-sync` or `npx --yes --package project-tiny-context-harness@latest ty-context sync` | Refreshes package-managed guidance, default Skills, Makefile include, context templates, tools and workflow YAML. It does not run migrations or perform semantic Context generation; it may block only direct asset-refresh safety issues such as invalid managed blocks or deprecated managed Skill overrides. |
|
|
278
280
|
| Upgrade | `make ty-context-upgrade` or `npx --yes --package project-tiny-context-harness@latest ty-context upgrade` | Use for releases marked `upgrade-required` or `manual-required`. Builds an upgrade plan, stops before writes when `blocked` items exist, otherwise applies `safe_pending` migrations, runs `sync` and `doctor`, and exits non-zero when manual follow-up or diagnostics remain. |
|
|
@@ -288,7 +290,7 @@ Use `npx --no-install ty-context ...` only when you explicitly want the already
|
|
|
288
290
|
| Harness validation | `make validate-harness` | Composite gate for `validate-context` and `validate-code-modularity`. |
|
|
289
291
|
| Context validation | `npx --yes --package project-tiny-context-harness@latest ty-context validate-context`, `make validate-context` | Checks required project recovery fields, Context graph metadata, declared paths/roles and fake test-execution claims. |
|
|
290
292
|
| Plan contract validation | `npx --yes --package project-tiny-context-harness@latest ty-context validate-plan-contract <plan.md\|dir>` | Checks Source-to-Context Coverage and Context-to-Implementation Binding for structural consistency, referenced path existence and weak-proof complete/bound contradictions. |
|
|
291
|
-
| Superpowers state validation | `npx --yes --package project-tiny-context-harness@latest ty-context validate-superpowers-state <dir>` | Checks canonical Superpowers `task-state.json`, source hashes, graph references, evidence/proof-layer consistency, stale evidence, sibling substitution, auditor blockers, derived drift and final completion rules. |
|
|
293
|
+
| Superpowers state validation | `npx --yes --package project-tiny-context-harness@latest ty-context validate-superpowers-state <dir>` | Checks canonical Superpowers `task-state.json`, source hashes, graph references, delivery scope fields/conflicts, evidence/proof-layer consistency, stale evidence, sibling substitution, auditor blockers, derived drift and final completion rules. |
|
|
292
294
|
| Plan acceptance validation | `npx --yes --package project-tiny-context-harness@latest ty-context validate-plan-acceptance <dir>` | Checks legacy matrix/verdict artifacts when no state exists; when `task-state.json` exists, validates state-backed derived artifacts. It rejects contradictory complete claims, dangling evidence references, weak-proof complete rows, missing proof layers, material/critical drift, unapproved sibling substitution, blocking auditor findings, raw secrets/tokens/cookies, generated active-count drift, missing plan/AC cross-references and declared surface/architecture binding gaps. `errors` block; `warnings` / `hygiene` report cleanup. |
|
|
293
295
|
| Superpowers state helpers | `npx --yes --package project-tiny-context-harness@latest ty-context superpowers <subcommand>` | Explicit `/superpowers-long-task` state helper for `init`, `compile`, `apply-slice-delta`, `derive`, `slice-gate`, `epoch-gate`, `final-gate` and `next-slices` under `tmp/ty-context/plan-acceptance/**`. |
|
|
294
296
|
| Diagnostics | `make ty-context-doctor` or `npx --yes --package project-tiny-context-harness@latest ty-context doctor` | Reports Harness root, package version, schema version and required Minimal Context paths. |
|
|
@@ -300,7 +302,7 @@ Technical architecture support is a Minimal Context capability: use restrained `
|
|
|
300
302
|
|
|
301
303
|
For long-running plans, RFCs or implementation proposals, invoke `/normal-long-task` to turn a plan plus relevant Context into a falsifiable acceptance checklist and an optional generic paste-ready goal/target-mode prompt. It also supports a two-document upstream input from Web GPT or another external planner: `Development Plan` for execution direction and `Acceptance and Tests` for target-mode acceptance input. If the plan already contains an explicit concrete acceptance checklist, the Skill copies that checklist verbatim into a separate full-checklist file instead of generating a competing checklist. The two-document packet path is strict mode: when required fields cannot be fully parsed from both documents, the Skill preserves the inputs, reports the missing fields, and stops without generating a checklist or goal/target-mode prompt. It is one pre-execution acceptance pass, not a task planner or workflow engine: it stores temporary inputs under `tmp/ty-context/plan-acceptance/**`, asks for confirmation when durable assumptions are unclear, and leaves execution evidence to the future executor, tests, CI, review or human acceptance. The generated prompt may require a local audit under the same temporary directory so future sessions can recover acceptance progress; that audit is not Context, not a quality proof and not a replacement for the project's Tiny Context workflow contract. When the prompt references a full checklist, that checklist is the acceptance authority; compact prompt text is only navigation, priority and recovery guidance.
|
|
302
304
|
|
|
303
|
-
When the next step explicitly needs Superpowers, invoke `/superpowers-long-task` on the Product / Architecture Source, Technical Realization Plan and Acceptance Checklist. It emits the `Superpowers input packet` and execution binding so the future executor sees which inputs feed Context Delta assessment, `superpowers:subagent-driven-development`, `superpowers:executing-plans`, TDD, `superpowers:verification-before-completion`, canonical `task-state.json`, append-only `events.ndjson`, generated `derived/**` views, proof-chain evidence and optional auditor review. This is Tiny Context's adapter layer for Superpowers workflows, aligned to the official Superpowers skills while remaining a Tiny Context-owned adapter rather than an upstream-owned schema. It may wrap Superpowers with authority, conformance and acceptance gates, but it must not redefine, duplicate or fork Superpowers execution mechanics; if a future Tiny Context-added step would conflict with, duplicate or override a Superpowers responsibility, stop and surface the boundary conflict instead of silently merging workflows. It cannot replace `/normal-long-task` for ordinary checklist preparation, does not route complexity, and does not derive a technical plan from a product plan; the Technical Realization Plan must already be a Superpowers-ready Markdown implementation plan or the Skill stops before generating a prompt. A two-document packet is accepted only when the first document explicitly contains both product/architecture source and technical realization plan sections. Product / Architecture Source, Technical Realization Plan and Acceptance Checklist remain the upstream authorities, while state/derived views/validator/auditor artifacts cannot rewrite them. The generated prompt also disambiguates `audit_task_complete`, `acceptance_target_status` and computed `product_goal_complete`; implementation / execution goals finish only when `product_goal_complete=true`, while a read-only audit goal can end at `audit_task_complete` only with a non-accepted verdict reported as `Audit workflow completed; acceptance target not complete.`, not as `Goal achieved`.
|
|
305
|
+
When the next step explicitly needs Superpowers, invoke `/superpowers-long-task` on the Product / Architecture Source, Technical Realization Plan and Acceptance Checklist. It emits the `Superpowers input packet` and execution binding so the future executor sees which inputs feed Context Delta assessment, `superpowers:subagent-driven-development`, `superpowers:executing-plans`, TDD, `superpowers:verification-before-completion`, canonical `task-state.json`, append-only `events.ndjson`, generated `derived/**` views, proof-chain evidence and optional auditor review. This is Tiny Context's adapter layer for Superpowers workflows, aligned to the official Superpowers skills while remaining a Tiny Context-owned adapter rather than an upstream-owned schema. It may wrap Superpowers with authority, conformance and acceptance gates, but it must not redefine, duplicate or fork Superpowers execution mechanics; if a future Tiny Context-added step would conflict with, duplicate or override a Superpowers responsibility, stop and surface the boundary conflict instead of silently merging workflows. It cannot replace `/normal-long-task` for ordinary checklist preparation, does not route complexity, and does not derive a technical plan from a product plan; the Technical Realization Plan must already be a Superpowers-ready Markdown implementation plan or the Skill stops before generating a prompt. A two-document packet is accepted only when the first document explicitly contains both product/architecture source and technical realization plan sections. Product / Architecture Source, Technical Realization Plan and Acceptance Checklist remain the upstream authorities, while state/derived views/validator/auditor artifacts cannot rewrite them. Capability-first delivery scope stays inside those same three inputs: source, plan items and ACs must explicitly distinguish reusable system capability build, representative sample validation, full population operation and out-of-scope backlog; `scope_conflict_requires_decision` blocks completion, and sample/framework evidence cannot prove full population unless the AC says so. The generated prompt also disambiguates `audit_task_complete`, `acceptance_target_status` and computed `product_goal_complete`; implementation / execution goals finish only when `product_goal_complete=true`, while a read-only audit goal can end at `audit_task_complete` only with a non-accepted verdict reported as `Audit workflow completed; acceptance target not complete.`, not as `Goal achieved`.
|
|
304
306
|
|
|
305
307
|
For Product Surface work, `context_surface_contract` turns broad product/page/UI principles into project-owned surface responsibilities. A Product Surface can be a Web page, mobile screen, desktop window, game UI/HUD/menu, CLI/TUI output, extension UI or embedded/device interface. Cross-surface contracts use the existing `contract` role; area-owned screen facts stay in `area` or `subdomain`; repeatable validation paths use `verification`. The Harness does not add a new surface-specific role or create business surface contracts during `init` or `upgrade`. Product Surface Context authoring is not a default product-quality validator; plan validators only check declared temporary surface bindings for structural consistency. Projects that want mandatory task blocks should add a separate project-local Skill, while `product-surface-contract.md` is only a compact managed template for optional Context authoring.
|
|
306
308
|
|
package/assets/README.md
CHANGED
|
@@ -94,7 +94,7 @@ That smoke packs the local workspace, installs it into a disposable repo, runs `
|
|
|
94
94
|
```sh
|
|
95
95
|
npm run preview:pack
|
|
96
96
|
cd /path/to/your/test-repo
|
|
97
|
-
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.2.
|
|
97
|
+
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.2.78.tgz
|
|
98
98
|
npx --no-install ty-context init --adopt
|
|
99
99
|
make validate-context
|
|
100
100
|
```
|
|
@@ -140,9 +140,11 @@ The ordinary long-task path uses `/normal-long-task`. It is the non-Superpowers
|
|
|
140
140
|
|
|
141
141
|
The Superpowers long-task path uses `/superpowers-long-task` when three inputs already exist: `Product / Architecture Source`, `Technical Realization Plan` and `Acceptance Checklist`. The product/architecture source preserves original intent and scope; the technical realization plan is the execution blueprint and plan-conformance source; the checklist is the acceptance authority. The Skill does not perform complexity routing: invocation means Superpowers long-task execution was already selected. Two-document compatibility is allowed only when the first document clearly contains both product/architecture source and technical realization plan sections. If only a product/architecture source and checklist exist, the Skill stops with a Missing Fields Report for a missing `Technical Realization Plan` instead of generating one. The technical realization plan must already satisfy the required Superpowers-ready Markdown implementation plan fields; if it does, the prompt binds it directly to Superpowers execution rather than regenerating the plan, and if it does not, the Skill stops before generating a prompt. The prompt is Tiny Context's adapter layer, aligned to the official Superpowers skills while remaining a Tiny Context-owned adapter rather than an upstream-owned schema. It may wrap Superpowers with Tiny Context authority, conformance and acceptance gates, but it must not redefine or fork Superpowers execution mechanics. It requires parent-level `Product Context Delta` and `Technical Context Delta` checks before implementation and uses a canonical state kernel under `tmp/ty-context/plan-acceptance/<plan-slug>/`: `task-state.json` is the only execution state source, `events.ndjson` is append-only and `derived/**` contains generated local audit, plan-conformance matrix, final acceptance verdict, progress ledger, evidence index, context alignment and final summary views. Complete acceptance rows are externally reviewable evidence claims derived from `task-state.evidence[]`: the checklist supplies the proof chain, fresh reviewable evidence must satisfy every required layer, and material drift, missing layers or unapproved sibling substitution prevent `complete`. Goal-mode wording separates `audit_task_complete`, `acceptance_target_status` and computed `product_goal_complete`: implementation / execution goals complete only when `ty-context superpowers final-gate` computes `product_goal_complete=true`; read-only audit goals may end at `audit_task_complete`, but a non-accepted verdict says `Audit workflow completed; acceptance target not complete.` and does not use unqualified `Goal achieved` or `update_goal(status="complete")` as acceptance of the user target.
|
|
142
142
|
|
|
143
|
+
The three inputs also carry capability-first delivery boundaries. Product / Architecture Source declares `delivery_scope`, `full_population_required`, samples that validate the claim, samples that do not validate it and out-of-scope backlog. Each Technical Realization Plan item declares delivery scope, capability target, representative samples, full-population boundary and non-required population. Each Acceptance Checklist item declares acceptance scope, what it validates and does not validate, sample boundary and full-population requirement. `scope_conflict_requires_decision` blocks completion when source, plan and checklist disagree between system capability build, representative sample validation and full-population operation. Sample evidence or framework-only implementation cannot prove all-provider, all-interface, all-platform or full-population completion unless the AC explicitly allows it; when full population is not explicitly required, generated views report it as `not_in_scope`.
|
|
144
|
+
|
|
143
145
|
For non-trivial Superpowers slices, the generated prompt requires a structured `slice-delta.json`. The executor applies it with `ty-context superpowers apply-slice-delta <workdir> <slice-delta.json>`, then runs `ty-context superpowers derive` and `ty-context superpowers slice-gate`. Each delta records touched plan items/ACs, code changes, closed and remaining proof layers, blockers, cleanup assertions, `progress_value` and canonical evidence records with `proves`, `does_not_prove`, freshness, redaction and reviewability. Default slice guidance is to group 2-4 strongly related missing layers that share an AC, runtime scenario, proof environment or verification path, while single-gap slices are reserved for blockers, contradictions or small metadata cleanup. The prompt also asks executors to classify missing layers, reuse DB/API/Browser environments only with unique proof prefixes and cleanup assertions, and run a stale/overclaim scan after deriving artifacts.
|
|
144
146
|
|
|
145
|
-
The generated Superpowers prompt uses Slice Gate / Epoch Gate / Final Gate cadence instead of running a full final gate after every slice. Progress Accounting tracks AC acceptance completion, engineering implementation progress, runtime/proof progress, artifact budget, proof-layer milestone status and workflow overhead in state and generated `derived/progress-ledger.*`. Workflow overhead backpressure asks executors to batch shared provider/browser/runtime/security epoch proof environments, prune stale artifacts and choose the Next 3-5 high-value clusters that close the most blocking AC/proof-layer gaps.
|
|
147
|
+
The generated Superpowers prompt uses Slice Gate / Epoch Gate / Final Gate cadence instead of running a full final gate after every slice. Progress Accounting tracks AC acceptance completion, engineering implementation progress, runtime/proof progress, system capability progress, representative sample progress, real object coverage, full population operation progress, artifact budget, proof-layer milestone status and workflow overhead in state and generated `derived/progress-ledger.*`. Workflow overhead backpressure asks executors to batch shared provider/browser/runtime/security epoch proof environments, prune stale artifacts and choose the Next 3-5 high-value clusters that close the most blocking AC/proof-layer gaps.
|
|
146
148
|
|
|
147
149
|
The recommended Superpowers layer is the specific [obra/Superpowers](https://github.com/obra/superpowers) plugin/workflow, not a generic planning substitute. After `/superpowers-long-task` accepts the input packet, prefer `superpowers:subagent-driven-development` when subagents are available and `superpowers:executing-plans` otherwise. Behavior changes should use `superpowers:test-driven-development`. Final gate order is derive all views, `superpowers:verification-before-completion`, `ty-context validate-superpowers-state <dir>`, `ty-context validate-plan-acceptance <dir>`, read-only auditor when available, rederive/revalidate if auditor fixes changed state or evidence, final stale/overclaim scan, then `ty-context superpowers final-gate <dir>` computes completion. The auditor reconstructs AC proof chains with a fixed auditor checklist and finds gaps, but does not become proof. Superpowers review and verification remain useful execution checks, but they cannot override Tiny Context gates: passing Superpowers review does not by itself prove plan conformance or checklist acceptance.
|
|
148
150
|
|
|
@@ -309,7 +311,7 @@ No. It checks that recovery facts exist and avoids fake test-result claims. Prod
|
|
|
309
311
|
|
|
310
312
|
It should stay smaller than a full process. Ordinary bug fixes and local refactors do not update Context unless they produce durable product, architecture, API, state or validation facts.
|
|
311
313
|
|
|
312
|
-
The default Skills are Minimal Context helpers for explicit product-planning, UI/UX-design, development-engineering, Product Surface Contract, full-project-export, Tiny Context upgrade and explicit long-task requests. Product, screen-flow, surface responsibility and durable engineering conclusions go to `project_context/**`; visual identity and design tokens go to root `DESIGN.md`. Export artifacts are temporary files under `tmp/ty-context/context-exports/**`, not Context. Long-task artifacts are temporary files under `tmp/ty-context/plan-acceptance/**`; they define completion criteria or execution evidence for a referenced plan but do not execute it or become durable Context. The ordinary long-task Skill is invoked as `/normal-long-task`: if the plan already contains an explicit concrete checklist, it reuses that checklist verbatim in the separate full-checklist file. For a two-document upstream input, the external planner should provide a `Development Plan` and an `Acceptance and Tests` packet; `/normal-long-task` preserves both source roles and, only when strict-mode required fields are fully parseable from both documents, turns them into the full checklist plus optional generic target prompt. When a generated prompt references a full checklist, that checklist is the authoritative acceptance standard; the compact prompt summary is only navigation and priority guidance. The Superpowers long-task Skill is invoked as `/superpowers-long-task`: it consumes `Product / Architecture Source`, `Technical Realization Plan` and `Acceptance Checklist`, emits the Superpowers-specific target-mode prompt, directly binds a Superpowers-ready external implementation plan when supplied, requires `Product Context Delta`, `Technical Context Delta`, `plan-conformance-matrix.*`, `final-acceptance-verdict.*` and externally reviewable proof-chain evidence during future execution, and stops if required fields are missing. The Harness upgrade Skill handles requests such as “upgrade Tiny Context” and “use the Tiny Context upgrade skill to upgrade this project” by following the release update mode, using `upgrade` for migration-bearing releases, and limiting manual cleanup to migration-scoped follow-up.
|
|
314
|
+
The default Skills are Minimal Context helpers for explicit product-planning, UI/UX-design, development-engineering, Product Surface Contract, full-project-export, Tiny Context upgrade and explicit long-task requests. Product, screen-flow, surface responsibility and durable engineering conclusions go to `project_context/**`; visual identity and design tokens go to root `DESIGN.md`. Export artifacts are temporary files under `tmp/ty-context/context-exports/**`, not Context. Long-task artifacts are temporary files under `tmp/ty-context/plan-acceptance/**`; they define completion criteria or execution evidence for a referenced plan but do not execute it or become durable Context. The ordinary long-task Skill is invoked as `/normal-long-task`: if the plan already contains an explicit concrete checklist, it reuses that checklist verbatim in the separate full-checklist file. For a two-document upstream input, the external planner should provide a `Development Plan` and an `Acceptance and Tests` packet; `/normal-long-task` preserves both source roles and, only when strict-mode required fields are fully parseable from both documents, turns them into the full checklist plus optional generic target prompt. When a generated prompt references a full checklist, that checklist is the authoritative acceptance standard; the compact prompt summary is only navigation and priority guidance. The Superpowers long-task Skill is invoked as `/superpowers-long-task`: it consumes `Product / Architecture Source`, `Technical Realization Plan` and `Acceptance Checklist`, emits the Superpowers-specific target-mode prompt, directly binds a Superpowers-ready external implementation plan when supplied, requires capability-first delivery scope fields, `Product Context Delta`, `Technical Context Delta`, `plan-conformance-matrix.*`, `final-acceptance-verdict.*` and externally reviewable proof-chain evidence during future execution, and stops if required fields are missing. The Harness upgrade Skill handles requests such as “upgrade Tiny Context” and “use the Tiny Context upgrade skill to upgrade this project” by following the release update mode, using `upgrade` for migration-bearing releases, and limiting manual cleanup to migration-scoped follow-up.
|
|
313
315
|
|
|
314
316
|
Multilingual trigger phrases are compatibility details. Public README, npm and launch copy stay English-first, and public/package-managed surfaces must remain English-complete; literal non-English examples are documented only where they explain generated Skill matching and must not be the sole activation path.
|
|
315
317
|
|
|
@@ -319,7 +321,7 @@ Technical architecture support is a Minimal Context capability: use restrained `
|
|
|
319
321
|
|
|
320
322
|
For long-running plans, RFCs or implementation proposals, invoke `/normal-long-task` to turn a plan plus relevant Context into a falsifiable acceptance checklist and an optional generic paste-ready goal/target-mode prompt. It also supports a two-document upstream input from Web GPT or another external planner: `Development Plan` for execution direction and `Acceptance and Tests` for target-mode acceptance input. If the plan already contains an explicit concrete acceptance checklist, the Skill copies that checklist verbatim into a separate full-checklist file instead of generating a competing checklist. The two-document packet path is strict mode: when required fields cannot be fully parsed from both documents, the Skill preserves the inputs, reports the missing fields, and stops without generating a checklist or goal/target-mode prompt. This is one pre-execution acceptance pass, not a task planner or workflow engine: it stores temporary inputs under `tmp/ty-context/plan-acceptance/**`, asks for confirmation when durable assumptions are unclear, and leaves execution evidence to the future executor, tests, CI, review or human acceptance. The generated prompt may require a local audit under the same temporary directory so future sessions can recover acceptance progress; that audit is not Context, not a quality proof and not a replacement for the project's Tiny Context workflow contract. The full checklist is the acceptance authority, while any compact prompt summary exists for navigation, priority and recovery after context compaction.
|
|
321
323
|
|
|
322
|
-
When the next step explicitly needs Superpowers, invoke `/superpowers-long-task` on the Product / Architecture Source, Technical Realization Plan and Acceptance Checklist. It emits the `Superpowers input packet` and execution binding so the future executor sees which inputs feed Context Delta assessment, `superpowers:subagent-driven-development`, `superpowers:executing-plans`, TDD, `superpowers:verification-before-completion`, canonical `task-state.json`, append-only `events.ndjson`, generated `derived/**` views, proof-chain evidence and optional auditor review. This is Tiny Context's adapter layer for Superpowers workflows, aligned to the official Superpowers skills while remaining a Tiny Context-owned adapter rather than an upstream-owned schema. It may wrap Superpowers with authority, conformance and acceptance gates, but it must not redefine, duplicate or fork Superpowers execution mechanics; if a future Tiny Context-added step would conflict with, duplicate or override a Superpowers responsibility, stop and surface the boundary conflict instead of silently merging workflows. It cannot replace `/normal-long-task` for ordinary checklist preparation, does not route complexity, and does not derive a technical plan from a product plan; the Technical Realization Plan must already be a Superpowers-ready Markdown implementation plan or the Skill stops before generating a prompt. A two-document packet is accepted only when the first document explicitly contains both product/architecture source and technical realization plan sections. Product / Architecture Source, Technical Realization Plan and Acceptance Checklist remain the upstream authorities, while state/derived views/validator/auditor artifacts cannot rewrite them. The generated prompt also disambiguates `audit_task_complete`, `acceptance_target_status` and computed `product_goal_complete`; implementation / execution goals finish only when `product_goal_complete=true`, while a read-only audit goal can end at `audit_task_complete` only with a non-accepted verdict reported as `Audit workflow completed; acceptance target not complete.`, not as `Goal achieved`.
|
|
324
|
+
When the next step explicitly needs Superpowers, invoke `/superpowers-long-task` on the Product / Architecture Source, Technical Realization Plan and Acceptance Checklist. It emits the `Superpowers input packet` and execution binding so the future executor sees which inputs feed Context Delta assessment, `superpowers:subagent-driven-development`, `superpowers:executing-plans`, TDD, `superpowers:verification-before-completion`, canonical `task-state.json`, append-only `events.ndjson`, generated `derived/**` views, proof-chain evidence and optional auditor review. This is Tiny Context's adapter layer for Superpowers workflows, aligned to the official Superpowers skills while remaining a Tiny Context-owned adapter rather than an upstream-owned schema. It may wrap Superpowers with authority, conformance and acceptance gates, but it must not redefine, duplicate or fork Superpowers execution mechanics; if a future Tiny Context-added step would conflict with, duplicate or override a Superpowers responsibility, stop and surface the boundary conflict instead of silently merging workflows. It cannot replace `/normal-long-task` for ordinary checklist preparation, does not route complexity, and does not derive a technical plan from a product plan; the Technical Realization Plan must already be a Superpowers-ready Markdown implementation plan or the Skill stops before generating a prompt. A two-document packet is accepted only when the first document explicitly contains both product/architecture source and technical realization plan sections. Product / Architecture Source, Technical Realization Plan and Acceptance Checklist remain the upstream authorities, while state/derived views/validator/auditor artifacts cannot rewrite them. Capability-first delivery scope stays inside those same three inputs: source, plan items and ACs must explicitly distinguish reusable system capability build, representative sample validation, full population operation and out-of-scope backlog; `scope_conflict_requires_decision` blocks completion, and sample/framework evidence cannot prove full population unless the AC says so. The generated prompt also disambiguates `audit_task_complete`, `acceptance_target_status` and computed `product_goal_complete`; implementation / execution goals finish only when `product_goal_complete=true`, while a read-only audit goal can end at `audit_task_complete` only with a non-accepted verdict reported as `Audit workflow completed; acceptance target not complete.`, not as `Goal achieved`.
|
|
323
325
|
|
|
324
326
|
Important usage note: Minimal Context intentionally keeps Context read order, Context/code priority and drift checks as agent-level soft constraints rather than machine-enforced gates. That tradeoff works well for short tasks, but long tasks with large context windows, multiple handoffs or many verification loops are expected to drift unless product intent, technical implementation target and acceptance target are externalized. Superpowers alone can still drift under this pressure: it strengthens execution discipline, but it does not by itself preserve source authority, prevent scope shrinkage, prove full conformance to the Technical Realization Plan or enforce AC-by-AC evidence against the Acceptance Checklist. Use `/normal-long-task` before long-running execution when ordinary checklist preparation is needed; use `/superpowers-long-task` when the three upstream inputs already exist and Superpowers execution is desired. Treat `task-state.json` as the only execution state source, `events.ndjson` as append-only, `derived/**` as generated reading views and `task-state.evidence[]` as the canonical evidence ledger. `validate-superpowers-state` and state-backed `validate-plan-acceptance` are still artifact/state-consistency validators, not product-quality proof; a subagent auditor is an extra gap-finding pass on top of executor self-evidence and validator checks, not a replacement for either. Passing Superpowers review or verification does not bypass incomplete state rows, weak evidence, missing proof layers or blocking auditor findings.
|
|
325
327
|
|
|
@@ -399,7 +401,7 @@ Use `npx --no-install ty-context ...` only when you explicitly want the already
|
|
|
399
401
|
| `npx --yes --package project-tiny-context-harness@latest ty-context check-modularity --touched [--limit 300] [--fail-on-warning]` | Reports selected handwritten source files over the physical line-count limit; `--file <path>` and `--base <ref>` select explicit files or branch changes, and config waivers are reported distinctly. |
|
|
400
402
|
| `npx --yes --package project-tiny-context-harness@latest ty-context validate-context` | Checks minimum project recovery fields, Context graph metadata, declared paths/roles and fake test-execution claims. |
|
|
401
403
|
| `npx --yes --package project-tiny-context-harness@latest ty-context validate-plan-contract <plan.md\|dir>` | Checks Source-to-Context Coverage and Context-to-Implementation Binding for structural consistency, referenced path existence and weak-proof complete/bound contradictions. |
|
|
402
|
-
| `npx --yes --package project-tiny-context-harness@latest ty-context validate-superpowers-state <dir>` | Checks canonical Superpowers `task-state.json`, source hashes, graph references, evidence/proof-layer consistency, stale evidence, sibling substitution, auditor blockers, derived drift and final completion rules. |
|
|
404
|
+
| `npx --yes --package project-tiny-context-harness@latest ty-context validate-superpowers-state <dir>` | Checks canonical Superpowers `task-state.json`, source hashes, graph references, delivery scope fields/conflicts, evidence/proof-layer consistency, stale evidence, sibling substitution, auditor blockers, derived drift and final completion rules. |
|
|
403
405
|
| `npx --yes --package project-tiny-context-harness@latest ty-context validate-plan-acceptance <dir>` | Checks legacy matrix/verdict artifacts when no state exists; when `task-state.json` exists, validates state-backed derived artifacts. It rejects contradictory complete claims, dangling evidence references, weak-proof complete rows, missing proof layers, material/critical drift, unapproved sibling substitution, blocking auditor findings, raw secrets/tokens/cookies, generated active-count drift, missing plan/AC cross-references and declared surface/architecture binding gaps. `errors` block; `warnings` / `hygiene` report cleanup. |
|
|
404
406
|
| `npx --yes --package project-tiny-context-harness@latest ty-context superpowers <subcommand>` | Explicit `/superpowers-long-task` state helper for `init`, `compile`, `apply-slice-delta`, `derive`, `slice-gate`, `epoch-gate`, `final-gate` and `next-slices` under `tmp/ty-context/plan-acceptance/**`. |
|
|
405
407
|
| `make validate-context` | Makefile wrapper for `validate-context`. |
|
package/assets/README.zh-CN.md
CHANGED
|
@@ -56,9 +56,11 @@ Tiny Context 有两个核心层。Minimal Context 是长期事实源层:说明
|
|
|
56
56
|
|
|
57
57
|
Superpowers 长程任务 Skill 用 `/superpowers-long-task`。如果下一步明确要 Superpowers 目标模式文本,推荐在三份输入都存在后调用:`Product / Architecture Source`(产品/架构原始意图源)、`Technical Realization Plan`(具体技术实现方案)和 `Acceptance Checklist`(验收清单)。它不做复杂度分流;调用它表示上游已经决定使用 Superpowers 长程执行。它不要求先跑 `/normal-long-task`,但也不会把产品方案现场翻译成技术方案;如果只有产品/架构方案和验收清单,Skill 会用 Missing Fields Report 停止并报告缺少 `Technical Realization Plan`。两份输入兼容只限第一份明确包含产品/架构源和技术实现方案两个章节。`Technical Realization Plan` 必须已经满足 Superpowers-ready Markdown implementation plan 的必填字段;满足时它跳过方案生成,直接绑定 Superpowers 执行,不满足时直接中断并报告缺失字段,不生成 prompt。它显式输出 `Superpowers 输入包` 和执行绑定,让未来 executor 清楚哪些输入进入 parent-level Product Context Delta / Technical Context Delta、slice-level new durable fact check、subagent/inline execution、TDD、`superpowers:verification-before-completion`、canonical `task-state.json`、append-only `events.ndjson`、generated `derived/**` views、proof-chain evidence 和 optional auditor review。这个 prompt 是面向 Superpowers workflow 的 Tiny Context 适配层,对齐官方 Superpowers skills,但不是上游维护的 schema;它可以在 Superpowers 外层增加 Tiny Context 的权威、对图纸和验收门禁,但不能重新定义、重复或分叉 Superpowers 执行机制。如果未来改动让 Tiny Context 新增步骤和官方 Superpowers 职责冲突、重复或覆盖,应停止修改并提示边界冲突,不要静默合并两套流程。它不生成技术方案或验收清单、不执行计划、不证明完成,也不会把临时 state、derived views 或 verdict 注册成 `project_context/**`。三输入是上游权威,state / derived views / validator / auditor 不能改写它们。`task-state.json` 是唯一执行状态源,`events.ndjson` 追加记录状态变更,`derived/**` 只生成 local audit、plan-conformance matrix、final acceptance verdict、progress ledger、evidence index、context alignment 和 final summary 等阅读视图。完整验收行按外部审计证据处理:proof chain 来自验收清单,fresh evidence 必须通过 `task-state.evidence[]` 满足每个 required layer,存在 material drift、缺 required layer 或未批准 sibling substitution 时不能标 `complete`。Goal mode 表述必须区分 `audit_task_complete`、`acceptance_target_status` 和 computed `product_goal_complete`:实现/执行目标只在 `ty-context superpowers final-gate` 计算出 `product_goal_complete=true` 时完成;只读审计目标可在 `audit_task_complete` 时结束,但 verdict 不是 accepted/complete 时,回复写 `Audit workflow completed; acceptance target not complete.`,不能用未限定的 `Goal achieved` 或 `update_goal(status="complete")` 表示用户验收目标已完成。
|
|
58
58
|
|
|
59
|
+
三份输入还必须承载 capability-first delivery 边界。Product / Architecture Source 声明 `delivery_scope`、`full_population_required`、哪些 representative samples 能验证 claim、哪些不能验证、以及 `out_of_scope_backlog`。每个 Technical Realization Plan item 声明 delivery scope、capability target、representative samples、full-population boundary 和 non-required population。每个 Acceptance Checklist item 声明 acceptance scope、`ac_validates`、`ac_does_not_validate`、sample boundary 和 full-population requirement。source / plan / checklist 在 system capability build、representative sample validation、full population operation 之间冲突时,`scope_conflict_requires_decision` 阻塞完成。sample evidence 或 framework-only implementation 不能证明 all-provider、all-interface、all-platform 或 full-population 完成,除非 AC 明确批准;未显式要求 full population 时,generated views 必须报告 `not_in_scope`。
|
|
60
|
+
|
|
59
61
|
对于非平凡 slice,生成的 Superpowers prompt 要求使用结构化 `slice-delta.json`。executor 通过 `ty-context superpowers apply-slice-delta <workdir> <slice-delta.json>` 应用 delta,然后运行 `ty-context superpowers derive` 和 `ty-context superpowers slice-gate`。每个 delta 记录 touched plan items / ACs、code changes、closed / remaining proof layers、blockers、cleanup assertions、`progress_value`,以及带有 `proves`、`does_not_prove`、freshness、redaction 和 reviewability 的 canonical evidence records。默认 slice 策略是把同一 AC、runtime 场景、proof 环境或验证路径下的 2-4 个强相关 missing layers 合并处理;单 gap slice 只留给 blocker、contradiction 或小型 metadata cleanup。prompt 还会要求先分类 missing layer、复用 DB/API/Browser 环境时使用唯一 proof prefix 和 cleanup assertion,并在生成 derived artifacts 后做 stale/overclaim scan。
|
|
60
62
|
|
|
61
|
-
生成的 Superpowers prompt 使用 Slice Gate / Epoch Gate / Final Gate 分层节奏,而不是每个 slice 后都跑完整 final gate。Progress Accounting 在 state 和 generated `derived/progress-ledger.*` 中记录 AC acceptance completion、engineering implementation progress、runtime/proof progress、artifact budget 和 workflow overhead。每个 slice 需要声明 artifact budget、proof-layer milestone 状态和 cleanup expectation。workflow overhead backpressure 要求 executor 批处理共享的 provider/browser/runtime/security epoch proof environment,清理 stale artifact,并选择 Next 3-5 high-value clusters 来优先关闭最多阻塞 AC / proof-layer gap。
|
|
63
|
+
生成的 Superpowers prompt 使用 Slice Gate / Epoch Gate / Final Gate 分层节奏,而不是每个 slice 后都跑完整 final gate。Progress Accounting 在 state 和 generated `derived/progress-ledger.*` 中记录 AC acceptance completion、engineering implementation progress、runtime/proof progress、system capability progress、representative sample progress、real object coverage、full population operation progress、artifact budget 和 workflow overhead。每个 slice 需要声明 artifact budget、proof-layer milestone 状态和 cleanup expectation。workflow overhead backpressure 要求 executor 批处理共享的 provider/browser/runtime/security epoch proof environment,清理 stale artifact,并选择 Next 3-5 high-value clusters 来优先关闭最多阻塞 AC / proof-layer gap。
|
|
62
64
|
|
|
63
65
|
重要使用提示:Minimal Context 有意把 Context 读取顺序、Context / 代码优先级和漂移检查保持为 agent 级软约束,而不是机器强制 edit-order gate。这个取舍适合短任务,但长任务、大上下文、多次交接或多轮验证时预期会漂移。单靠 Superpowers 在这类压力下仍可能漂移:它能增强执行纪律,但本身不负责保留上游 source authority、防止 scope shrinkage、证明完整符合 Technical Realization Plan,或按 Acceptance Checklist 逐 AC 强制证据成立。普通 checklist 准备需要 `/normal-long-task`;已有产品/架构原始意图源、具体技术实现方案和验收清单且需要 Superpowers 时,可直接用 `/superpowers-long-task`。`Product Context Delta` 判断产品逻辑、页面职责、信息架构和验收语义是否需要写入 Context;`Technical Context Delta` 判断 API/schema、模块边界、runtime/state、验证/部署路径和稳定技术取舍是否需要写入 Context。`task-state.json` 是唯一执行状态源,`events.ndjson` 追加记录状态变化,`derived/**` 是生成阅读视图,`task-state.evidence[]` 是 canonical evidence ledger;local audit 只是 generated progress/recovery view,不能裁判完成;审计流程完成也不等于被验收目标完成。使用目标模式执行方案时,目标结束条件对齐 computed `product_goal_complete=true`,只读审计目标才可把 `audit_task_complete` 当元任务结束。最终顺序是 derive all views -> verification-before-completion -> `validate-superpowers-state` -> state-backed `validate-plan-acceptance` -> read-only auditor -> stale/overclaim scan -> `ty-context superpowers final-gate` 计算 completion;若审计后修改 state/evidence,需 rederive 并重跑两个 validator。`validate-plan-contract`、`validate-superpowers-state` 和 `validate-plan-acceptance` 只检查临时 artifact/state 自洽、引用存在、弱证据 complete 行、缺 required proof layer、material/critical drift、sibling substitution 和已声明的 surface/architecture binding 一致性,不证明产品质量。有 subagent 能力时,Superpowers 目标提示会把 subagent 作为只读 auditor 加在主 agent 自证和 validator 之后;auditor 用固定 auditor checklist 找 gap,不是 proof source。Superpowers review 和 verification 仍然有价值,但不能覆盖 Tiny Context gates;通过 Superpowers review 不等于证明 plan conformance 或 checklist acceptance。
|
|
64
66
|
|
|
@@ -20,15 +20,16 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
20
20
|
1. 先读取 `project_context/global.md`、`project_context/architecture.md` 和 `project_context/context.toml`,按 default area、triggers、read_when 选择相关 context。
|
|
21
21
|
2. 先确认用户目标、约束、成功标准、影响产品域、现有验证 / 部署关键路径和风险;能从代码或 Context 发现的事实不要反复询问用户。
|
|
22
22
|
3. `project_context/**` 决定“应该是什么”:模块职责、归属、架构边界、接口方向、契约语义和禁止依赖;代码决定“现在实现到了哪里”。代码不能静默重定义 Context。
|
|
23
|
-
4. 第一处代码编辑前,若任务影响 durable architecture boundary、module ownership、API / Schema / data contract、state / runtime semantics、dependency direction、verification / deployment semantics 或 durable rationale / tradeoff,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`,并显式写 `Architecture Context Hit` 和 `Decision Rationale Hit: existing|required|none`。如果输入包含产品方案、架构方案、技术方案、实现方案或验收方案,先在 `plan.md` 或等价临时计划面做 Source-to-Context Coverage,确认方案中的 durable architecture / ownership / API / runtime / verification constraints 已被现有 Context 覆盖、需要更新、仅属 task-local、显式 out-of-scope、需要用户决策或仍 under-scoped。
|
|
24
|
-
5. 普通 bug fix、局部样式、局部实现漂移修复、小重构、package/release 处理、测试修复或探索性 spike 不强制编译架构 / rationale 任务契约,也不更新 Context;一旦形成长期工程结论,继续对齐或交付前必须回写 Context。不要把 Context 机械补成代码改动摘要。
|
|
23
|
+
4. 第一处代码编辑前,若任务影响 durable architecture boundary、module ownership、API / Schema / data contract、state / runtime semantics、dependency direction、verification / deployment semantics 或 durable rationale / tradeoff,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`,并显式写 `Architecture Context Hit` 和 `Decision Rationale Hit: existing|required|none`。如果输入包含产品方案、架构方案、技术方案、实现方案或验收方案,先在 `plan.md` 或等价临时计划面做 Source-to-Context Coverage,确认方案中的 durable architecture / ownership / API / runtime / verification constraints 已被现有 Context 覆盖、需要更新、仅属 task-local、显式 out-of-scope、需要用户决策或仍 under-scoped。
|
|
24
|
+
5. 普通 bug fix、局部样式、局部实现漂移修复、小重构、package/release 处理、测试修复或探索性 spike 不强制编译架构 / rationale 任务契约,也不更新 Context;一旦形成长期工程结论,继续对齐或交付前必须回写 Context。不要把 Context 机械补成代码改动摘要。
|
|
25
25
|
6. 如果代码、搜索结果或相邻实现与 Context 冲突,显式标记为实现漂移、缺失工作或 Context 过期,不要用当前代码形态反推模块归属。
|
|
26
26
|
7. 涉及已有 Context 的实现判断,先做轻量对齐:
|
|
27
27
|
- Context expectation
|
|
28
28
|
- Current code evidence
|
|
29
29
|
- Gap
|
|
30
30
|
- Proposed change
|
|
31
|
-
8. 涉及模块原则、模块逻辑、设计原因、API / Schema、状态语义、验证设计或 capability / metric / acceptance claim 时,先做 Module Principle / Design Gate:列出命中的模块设计上下文来源,说明这些原则 / 逻辑控制本次哪些实现或验证选择,再选择实现路径、验证 claim、probe 参数或 fallback。命令、probe、当前实现形态和被触碰文件大小是执行实例或维护风险,不能反推或覆盖模块设计目标。
|
|
31
|
+
8. 涉及模块原则、模块逻辑、设计原因、API / Schema、状态语义、验证设计或 capability / metric / acceptance claim 时,先做 Module Principle / Design Gate:列出命中的模块设计上下文来源,说明这些原则 / 逻辑控制本次哪些实现或验证选择,再选择实现路径、验证 claim、probe 参数或 fallback。命令、probe、当前实现形态和被触碰文件大小是执行实例或维护风险,不能反推或覆盖模块设计目标。
|
|
32
|
+
- 对外部产品/架构源、技术实现方案或验收清单中的 delivery / acceptance scope,必须显式区分 `system_capability_build`、`representative_sample_validation`、`full_population_operation`、`full_population_not_required` 和 out-of-scope backlog。不要把若干具体对象运行结果当作可复用系统能力完成,也不要把 framework-only 实现当作全量真实对象已完成;sample provider / interface / page 证据不能替代 all-provider / all-interface / all-platform / full-population 完成,除非 AC 明确批准该边界。
|
|
32
33
|
9. 涉及 Product Surface(Web 页面、移动/桌面屏幕、游戏 UI/HUD/菜单、CLI/TUI 输出、扩展或设备界面)、表单/配置、输入、选择、搜索、筛选、调度/时间、预算/配额/限流或状态反馈的实现方案时,检查当前代码是否只是暴露字段,还是满足了已有 Context、Surface Contract、页面职责和控件任务框架;实现收尾要能给出简短 Surface/Context Conformance 证据。
|
|
33
34
|
- 若存在 Product Surface Contract,Task Contract 必须包含 Surface Contract Hit、main allows/forbids、drilldown ownership、long-task state requirement、implementation drift 和 verification。
|
|
34
35
|
- 若缺失且本任务创建 durable surface responsibility,设置 `Context Delta: required`,先用 `context_surface_contract` 或项目 Context 写入具体 surface 职责,再继续实现。
|
|
@@ -45,13 +46,13 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
45
46
|
- 默认只实施高收益、低风险、语义稳定的候选项。
|
|
46
47
|
- 不为一次性代码、不稳定语义或纯粹好看的架构做抽象。
|
|
47
48
|
13. 当人工流程呈现重复、确定性、容易漏步骤或顺序影响正确性时,主动评估是否应沉淀为 repo-local tool/script。脚本应放在 owning module 的工具目录并配测试;可恢复的执行入口、参数约束和适用边界写入对应 verification / deployment Context。Skill 只记录这类脚本化机会识别原则,不承载具体模块命令、provider id、artifact 路径或一次性运行结果。
|
|
48
|
-
14. 需要沉淀长期事实时,只更新 `project_context/**`:
|
|
49
|
+
14. 需要沉淀长期事实时,只更新 `project_context/**`:
|
|
49
50
|
- 全局工程取舍、跨产品域索引或当前状态写入 `global.md`。
|
|
50
51
|
- 产品域 API、数据契约、关键约束、入口和风险写入对应 area / subdomain Context。
|
|
51
52
|
- 跨域接口语义写入 `context_role: contract` 或 manifest role 为 `contract` 的 Context;关键重复验证路径写入 `verification`;关键部署、运行拓扑或云端初始化路径写入 `deployment`;代码入口索引用 `implementation-index`;底层理论源用 `foundation`;历史归档索引用 `archive`。
|
|
52
53
|
- 新 context unit 可新增 `project_context/areas/<unit>.md`,并更新 `global.md#Context Index`;复杂项目同时更新 `project_context/context.toml`。
|
|
53
54
|
- 如果 `upgrade` 自动把深层 `.md` 注册成 area,但语义上更像 foundation / contract / archive,后续应显式调整 manifest role;不要依赖自动迁移判断语义。
|
|
54
|
-
15. 实现收尾时做 `Contract Conformance` 和 Context drift check:确认代码没有引入未沉淀的长期事实,且 Context 没有退化成普通实现摘要;若存在 `plan.md` / 等价临时计划面,必须反查 Source-to-Context Coverage、Context-to-Implementation Binding 和 Task Contract,确认没有未处理的 `under_scoped` / `new_context_required` / `needs_user_decision`,也没有 non-bound implementation rows。交付说明只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`。Conformance 说明本次契约满足情况、未满足或延期项和验证入口;一次性证据、截图结果、测试日志、任务契约和实现摘要不写入 Context。
|
|
55
|
+
15. 实现收尾时做 `Contract Conformance` 和 Context drift check:确认代码没有引入未沉淀的长期事实,且 Context 没有退化成普通实现摘要;若存在 `plan.md` / 等价临时计划面,必须反查 Source-to-Context Coverage、Context-to-Implementation Binding 和 Task Contract,确认没有未处理的 `under_scoped` / `new_context_required` / `needs_user_decision`,也没有 non-bound implementation rows。交付说明只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`。Conformance 说明本次契约满足情况、未满足或延期项和验证入口;一次性证据、截图结果、测试日志、任务契约和实现摘要不写入 Context。
|
|
55
56
|
16. Context 只能声明验证 / 部署关键路径或验收信号,不能伪造“测试已通过”或“部署已成功”。
|
|
56
57
|
17. Verification / Deployment Role Context 只记录长期可复用的重复执行路径事实:特殊准备、最短命令或路径、预期阶段 / 信号、可接受 warning、已排除的重复探索点。不要记录一次性测试日志、完整输出、临时 JSON、CI artifact、测试报告、release ledger、secret、token、cookie、device id 或 raw payload。
|
|
57
58
|
|
|
@@ -64,37 +65,38 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
64
65
|
## 任务契约编译
|
|
65
66
|
|
|
66
67
|
- 任务契约是当前工程任务的编译产物,不是事实源、tech plan、ADR、implementation doc 或长期 Context;默认留在方案、交付说明或 PR 文本中。
|
|
67
|
-
- `Context Delta` 必须先出现,取值为 `none` 或 `required`:
|
|
68
|
-
- `none`:本次只是按既有 Context / 架构原则落地,不新增长期事实。
|
|
69
|
-
- `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
|
|
70
|
-
- `Task Contract` 用短列表说明 capability、owner、upstream / downstream、allowed / forbidden dependency、input / output / state / persistence、failure / retry / timeout / degraded / recovery、observability、performance、security、non-goals 和 verification path。
|
|
71
|
-
- 高风险工程任务只新增这两个显性 Task Contract 字段,不新增长模板或第二套 durable-fact gate:
|
|
72
|
-
- `Architecture Context Hit: <architecture.md | area/subdomain Context | contract Context | Module Design Capsule | none>`:命名控制本次技术判断的 Context。若命中 `none` 且本任务创建 durable architecture meaning,`Context Delta` 必须是 `required`。
|
|
73
|
-
- `Decision Rationale Hit: <existing | required | none>`:`existing` 表示现有 Context 已解释 durable reason;`required` 表示本任务创建或改变 durable rationale、rejected alternative、tradeoff 或 future-change constraint,必须走 `Context Delta: required`;`none` 表示没有稳定 rationale 或变化局部且自明。
|
|
74
|
-
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement、implementation drift 和 conformance verification。
|
|
68
|
+
- `Context Delta` 必须先出现,取值为 `none` 或 `required`:
|
|
69
|
+
- `none`:本次只是按既有 Context / 架构原则落地,不新增长期事实。
|
|
70
|
+
- `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
|
|
71
|
+
- `Task Contract` 用短列表说明 capability、owner、upstream / downstream、allowed / forbidden dependency、input / output / state / persistence、failure / retry / timeout / degraded / recovery、observability、performance、security、non-goals 和 verification path。
|
|
72
|
+
- 高风险工程任务只新增这两个显性 Task Contract 字段,不新增长模板或第二套 durable-fact gate:
|
|
73
|
+
- `Architecture Context Hit: <architecture.md | area/subdomain Context | contract Context | Module Design Capsule | none>`:命名控制本次技术判断的 Context。若命中 `none` 且本任务创建 durable architecture meaning,`Context Delta` 必须是 `required`。
|
|
74
|
+
- `Decision Rationale Hit: <existing | required | none>`:`existing` 表示现有 Context 已解释 durable reason;`required` 表示本任务创建或改变 durable rationale、rejected alternative、tradeoff 或 future-change constraint,必须走 `Context Delta: required`;`none` 表示没有稳定 rationale 或变化局部且自明。
|
|
75
|
+
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement、implementation drift 和 conformance verification。
|
|
75
76
|
- 工程 / RFC / 实现类任务的 `Task Contract` 必须包含 `Modularity Check: none|required|exception`:
|
|
76
77
|
- `none`:没有超限计划 / touched 手写源码文件,或本次没有向超限文件增加新职责。
|
|
77
78
|
- `required`:拆分是本次验收条件,应按 abstraction / decomposition scan 的职责边界完成。
|
|
78
79
|
- `exception`:本次触碰超限文件但暂不拆;只有默认 `modularity.policy: scoped_waivers` 允许此路径,且必须已有或同步新增 `<harnessRoot>/config.yaml` `modularity.waivers` 记录文件、收窄分类、原因和后续拆分边界。若项目设置 `modularity.policy: strict_except_generated`,不得用 legacy waiver 绕过超限手写源码,交付说明只记录本次是否新增职责以及为什么没有拆。
|
|
79
|
-
- `Applicable Module Design` 是高风险任务的前置字段:列出命中的 Context / Skill 来源、适用的 Principles、Design Logic 和 Design Rationale,以及它们控制的当前实现或验证选择。
|
|
80
|
-
- `Principle Decision Gate` 要写明首选执行路径、fallback / degraded path 的进入条件,以及什么证据不能证明本次目标。涉及 capability、metric 或 acceptance claim 时,先声明要证明的 claim,再选择命令或 probe。
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
- `Coverage
|
|
85
|
-
- `
|
|
86
|
-
- `Binding
|
|
87
|
-
- `
|
|
88
|
-
- `
|
|
89
|
-
- `
|
|
90
|
-
-
|
|
80
|
+
- `Applicable Module Design` 是高风险任务的前置字段:列出命中的 Context / Skill 来源、适用的 Principles、Design Logic 和 Design Rationale,以及它们控制的当前实现或验证选择。
|
|
81
|
+
- `Principle Decision Gate` 要写明首选执行路径、fallback / degraded path 的进入条件,以及什么证据不能证明本次目标。涉及 capability、metric 或 acceptance claim 时,先声明要证明的 claim,再选择命令或 probe。
|
|
82
|
+
- 若 Task Contract 或验收方案涉及 capability-first delivery boundary,必须记录 source/plan/AC 对 `delivery_scope`、`acceptance_scope`、`full_population_required`、representative sample boundary、non-required population / backlog 的一致性;发现 system capability build 与 full population operation 冲突时,按 `scope_conflict_requires_decision` 处理,不能靠实现方便路径或样本证据自行裁决。
|
|
83
|
+
- 对长任务、多模块、多 agent、外部产品/架构/技术/实现/验收方案输入、容易发生 `Context Delta` 调头或多轮验证的任务,使用 `plan.md` 或等价临时计划面暂存 `Source-to-Context Coverage`、`Context-to-Implementation Binding`、`Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
|
|
84
|
+
- small code task 指现有 Context 已足够、且不改变 durable product / architecture / API-schema / runtime-state / verification-deployment / security-redaction / surface ownership 事实的局部实现任务;它按语义风险判断,不按代码行数判断,不应创建 `plan.md`、完整 trace tables、Source-to-Context Coverage 或 Context-to-Implementation Binding,除非它发现长期事实变化或扩展成高风险工作。
|
|
85
|
+
- `Source-to-Context Coverage` 表使用字段:`Source item | Durable constraint | Type | Existing Context Hit | Context action | Owning Context | Coverage status`。这张表只回答 source 约束是否进入或命中 Context,不写实现路径。
|
|
86
|
+
- `Coverage status` 取值:`covered`、`new_context_required`、`context_updated`、`task_local_only`、`out_of_scope_explicit`、`needs_user_decision`、`under_scoped`。存在 `under_scoped` 或未处理的 `new_context_required` / `needs_user_decision` 时,不能声称已按方案完整实现。
|
|
87
|
+
- `Context-to-Implementation Binding` 表使用字段:`Context fact | Implementation obligation | Expected surfaces | Implemented paths | Forbidden shortcuts | Verification path | Binding status`。
|
|
88
|
+
- `Binding status` 取值:`bound`、`partial`、`missing`、`blocked`、`out_of_scope_explicit`、`needs_user_decision`、`contradicted_by_current_state`。runtime/API/worker 项不能只用测试名或 browser checked path 冒充 `bound`。
|
|
89
|
+
- `plan.md` 中出现的长期工程事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
|
|
90
|
+
- `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
|
|
91
|
+
- `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失或 source coverage under-scoped 回 `Context Delta` 并先更新 Context。
|
|
92
|
+
- 不为 small code task、普通代码修改、bug fix、小重构、package/release 处理、测试修复、探索性 spike 或仅因 touched file 过大强制编译架构 / rationale 任务契约;大文件只走 `Modularity Check` 的拆分 / exception 判断。
|
|
91
93
|
|
|
92
94
|
## 模块设计上下文写法
|
|
93
95
|
|
|
94
96
|
- 模块设计上下文应是 Minimal Context,不是设计论文;只保留短、准、稳定、会影响后续实现或验证选择的内容。
|
|
95
|
-
- `Principles` 写稳定执行约束;`Design Logic` 写模块如何判断、选择、降级或组合能力;`Design Rationale` 只写会改变后续判断的原因、rejected alternative 或 tradeoff。
|
|
96
|
-
- `Current Standard`、`Verification Paths`、阈值、命令和 probe 参数是当前执行实例,不是永久原则;规则变化时更新对应 Context,而不是让旧命令继续定义目标。
|
|
97
|
-
- 不编造 rationale;仅由当前代码形态反推的理由、一次性证据、实现摘要、PR notes、命令输出、截图审查、debug 过程、agent reasoning、完整日志、临时 JSON、raw payload、测试报告和任务契约不进入高频模块原则段。
|
|
97
|
+
- `Principles` 写稳定执行约束;`Design Logic` 写模块如何判断、选择、降级或组合能力;`Design Rationale` 只写会改变后续判断的原因、rejected alternative 或 tradeoff。
|
|
98
|
+
- `Current Standard`、`Verification Paths`、阈值、命令和 probe 参数是当前执行实例,不是永久原则;规则变化时更新对应 Context,而不是让旧命令继续定义目标。
|
|
99
|
+
- 不编造 rationale;仅由当前代码形态反推的理由、一次性证据、实现摘要、PR notes、命令输出、截图审查、debug 过程、agent reasoning、完整日志、临时 JSON、raw payload、测试报告和任务契约不进入高频模块原则段。
|
|
98
100
|
|
|
99
101
|
## 输出边界
|
|
100
102
|
|
|
@@ -105,17 +107,17 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
105
107
|
|
|
106
108
|
## 建议沉淀位置
|
|
107
109
|
|
|
108
|
-
- `global.md#Design Rationale`:跨模块工程取舍。
|
|
109
|
-
- `architecture.md#Design Rationale`:架构级选择、rejected alternatives 和 tradeoffs。
|
|
110
|
-
- `global.md#Current State`:影响后续恢复的实现状态。
|
|
111
|
-
- `areas/*.md#User / System Contract`:模块可见行为、API、CLI、UI 或数据契约。
|
|
112
|
-
- `areas/*.md#Module Design Capsule`:模块级 principles、design logic 和会影响后续判断的 rationale。
|
|
113
|
-
- `areas/*.md#Core Data / API / State`:关键数据结构、接口、状态流或规则。
|
|
114
|
-
- `areas/*.md#Key Constraints`:性能、安全、兼容、集成或维护约束。
|
|
115
|
-
- role=`contract` Context:跨域 API / schema / event / interface 语义及其 durable rationale。
|
|
116
|
-
- role=`decision-rationale` Context:更大或跨切面的稳定设计原因。
|
|
117
|
-
- `areas/*.md#Code Entry Points`:未来 agent 需要快速定位的代码入口。
|
|
118
|
-
- `areas/*/verification.md` 或 role=`verification` Context:关键测试、smoke、CI、probe 或验证重复执行路径。
|
|
119
|
-
- `areas/*/deployment.md` 或 role=`deployment` Context:关键部署、云端初始化、运行拓扑、健康检查或回滚重复执行路径。
|
|
120
|
-
- `DESIGN.md`:视觉 identity、design token 和视觉 rationale。
|
|
121
|
-
- `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。
|
|
110
|
+
- `global.md#Design Rationale`:跨模块工程取舍。
|
|
111
|
+
- `architecture.md#Design Rationale`:架构级选择、rejected alternatives 和 tradeoffs。
|
|
112
|
+
- `global.md#Current State`:影响后续恢复的实现状态。
|
|
113
|
+
- `areas/*.md#User / System Contract`:模块可见行为、API、CLI、UI 或数据契约。
|
|
114
|
+
- `areas/*.md#Module Design Capsule`:模块级 principles、design logic 和会影响后续判断的 rationale。
|
|
115
|
+
- `areas/*.md#Core Data / API / State`:关键数据结构、接口、状态流或规则。
|
|
116
|
+
- `areas/*.md#Key Constraints`:性能、安全、兼容、集成或维护约束。
|
|
117
|
+
- role=`contract` Context:跨域 API / schema / event / interface 语义及其 durable rationale。
|
|
118
|
+
- role=`decision-rationale` Context:更大或跨切面的稳定设计原因。
|
|
119
|
+
- `areas/*.md#Code Entry Points`:未来 agent 需要快速定位的代码入口。
|
|
120
|
+
- `areas/*/verification.md` 或 role=`verification` Context:关键测试、smoke、CI、probe 或验证重复执行路径。
|
|
121
|
+
- `areas/*/deployment.md` 或 role=`deployment` Context:关键部署、云端初始化、运行拓扑、健康检查或回滚重复执行路径。
|
|
122
|
+
- `DESIGN.md`:视觉 identity、design token 和视觉 rationale。
|
|
123
|
+
- `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。
|
|
@@ -55,14 +55,17 @@ The input must fully expose these fields:
|
|
|
55
55
|
- original requirement source or original plan summary.
|
|
56
56
|
- durable product intent when applicable: product capability, user flow, business state/rule, page/surface responsibility, information architecture, product ownership, status meaning, operation boundary or acceptance semantics.
|
|
57
57
|
- durable architecture intent when applicable: module boundary, dependency direction, API/schema/data/event contract, worker/runtime/state-machine semantics, verification/deployment path or stable technical tradeoff.
|
|
58
|
+
- Product / Architecture Source delivery fields: `delivery_scope` (`system_capability_build`, `representative_sample_validation`, `full_population_operation` or `mixed_scope_requires_boundary`), `full_population_required`, `representative_samples_validate`, `representative_samples_do_not_validate` and `out_of_scope_backlog`.
|
|
58
59
|
- Technical Realization Plan path or pasted text.
|
|
59
60
|
- traceable plan items or sections that affect behavior and can be executed like a Superpowers Markdown implementation plan.
|
|
61
|
+
- each behavior-affecting Technical Realization Plan item delivery fields: `delivery_scope` (`system_capability_build`, `representative_sample_validation`, `full_population_operation` or `out_of_scope_backlog`), `capability_target`, `representative_samples`, `full_population_boundary` and `non_required_population`.
|
|
60
62
|
- expected implementation surfaces when applicable: code, API/schema, UI/page, worker/runtime, artifact, data, tests.
|
|
61
63
|
- required code/API/schema/UI/worker/runtime/data/test/evidence mapping when applicable.
|
|
62
64
|
- full-scope versus sample/optional boundaries.
|
|
63
65
|
- explicitly non-completing shortcuts, such as local-only enhancement, old page continuing to own a moved responsibility, sampled path, plan-only work or test-only patch.
|
|
64
66
|
- full acceptance checklist path or pasted text.
|
|
65
67
|
- acceptance items or AC IDs.
|
|
68
|
+
- each Acceptance Checklist item delivery fields: `acceptance_scope` (`system_capability_build`, `representative_sample_validation`, `full_population_operation` or `full_population_not_required`), `ac_validates`, `ac_does_not_validate`, `sample_boundary` and `full_population_required`.
|
|
66
69
|
- required evidence and verification method per AC.
|
|
67
70
|
- required tests or explicit no-test scope.
|
|
68
71
|
- valid and invalid evidence rules.
|
|
@@ -101,6 +104,8 @@ Do not let a compact target prompt override the product/architecture source, tec
|
|
|
101
104
|
- Acceptance Checklist owns ACs, completion semantics, required proof layers, invalid evidence rules and final acceptance state.
|
|
102
105
|
- `task-state.json` is execution state compiled from the three inputs. `events.ndjson`, generated derived views, validator output, evidence index and auditor report are execution/evidence artifacts. They cannot narrow, rewrite or replace the upstream sources.
|
|
103
106
|
- When sources conflict, stop or report the conflict instead of letting a downstream artifact silently change scope, plan or acceptance.
|
|
107
|
+
- Capability-first delivery boundaries are explicit input fields, not inferred prose. Product / Architecture Source owns overall delivery scope and full-population requirement; Technical Realization Plan items own whether each item builds reusable system capability, validates representative samples, performs full-population operation or records out-of-scope backlog; Acceptance Checklist items own what the AC validates, what it does not validate and whether full population is required.
|
|
108
|
+
- `scope_conflict_requires_decision` is blocking when source, plan and checklist disagree between system capability build, representative sample validation and full-population operation. Do not resolve it from local audit, matrix/verdict wording, sampled evidence or executor judgment.
|
|
104
109
|
- Tiny Context additions may wrap Superpowers with authority, conformance and acceptance gates, but they must not redefine, duplicate or fork official Superpowers execution mechanics. If a future change would make a Tiny Context-added step conflict with, duplicate or override an official Superpowers responsibility, stop and surface the boundary conflict instead of silently merging the workflows.
|
|
105
110
|
|
|
106
111
|
## Canonical State Kernel
|
|
@@ -132,6 +137,7 @@ Rules:
|
|
|
132
137
|
- The executor updates state through `slice-delta.json` and `ty-context superpowers apply-slice-delta`, not by hand-editing generated views.
|
|
133
138
|
- `task-state.evidence[]` is canonical. Each evidence record must include `proves`, `does_not_prove`, freshness, command/artifact/reproduction data, redaction status and reviewability.
|
|
134
139
|
- No proof layer can be complete without fresh reviewable evidence mapped through `task-state.evidence[]`.
|
|
140
|
+
- `task-state.delivery.product_architecture_scope`, `task-state.delivery.scope_conflicts`, plan item delivery fields, AC acceptance fields and `state.progress.system_capability_progress`, `representative_sample_progress`, `real_object_coverage` and `full_population_operation_progress` are canonical delivery-boundary state. Derived views expose them; they are not WebGPT outputs.
|
|
135
141
|
- Agents must not hand-set `product_goal_complete`; `ty-context superpowers final-gate` computes it.
|
|
136
142
|
|
|
137
143
|
Canonical commands:
|
|
@@ -184,6 +190,7 @@ Each behavior-affecting Technical Realization Plan item must have a trace entry
|
|
|
184
190
|
|
|
185
191
|
- plan item id and plan requirement.
|
|
186
192
|
- acceptance ids covered by the plan item when applicable.
|
|
193
|
+
- delivery_scope, capability_target, representative_samples, full_population_boundary and non_required_population.
|
|
187
194
|
- expected surfaces.
|
|
188
195
|
- implemented paths.
|
|
189
196
|
- missing paths.
|
|
@@ -212,6 +219,8 @@ Hard rules:
|
|
|
212
219
|
|
|
213
220
|
- Passing tests does not imply plan conformance.
|
|
214
221
|
- A sampled implementation path does not imply full plan implementation.
|
|
222
|
+
- Running several concrete objects does not by itself prove the reusable automation or system capability is complete.
|
|
223
|
+
- Implementing the automation framework does not prove every real object has completed.
|
|
215
224
|
- A local audit cannot narrow plan scope or mark completion.
|
|
216
225
|
- Scope correction requires explicit user approval or a revised product/architecture source, Technical Realization Plan and checklist.
|
|
217
226
|
- Every behavior-affecting plan section must have an implementation trace entry.
|
|
@@ -228,6 +237,7 @@ Each AC verdict entry must include:
|
|
|
228
237
|
- AC id or acceptance item.
|
|
229
238
|
- related plan item ids when applicable.
|
|
230
239
|
- status.
|
|
240
|
+
- acceptance_scope, ac_validates, ac_does_not_validate, sample_boundary and full_population_required.
|
|
231
241
|
- required evidence.
|
|
232
242
|
- required proof chain when the checklist or plan requires multiple evidence layers.
|
|
233
243
|
- fresh evidence.
|
|
@@ -255,6 +265,8 @@ Hard rules:
|
|
|
255
265
|
- `validate-plan-acceptance` rejects state/derived drift, contradictory matrix/verdict JSON, weak-proof complete rows, missing cross-references and declared surface/architecture binding gaps; it checks artifact consistency and references, not product quality.
|
|
256
266
|
- Current API/UI/runtime/data/test contradictions override historical passing evidence.
|
|
257
267
|
- local audit, subagent summaries, final result card text, passing test logs, stale artifacts, partial smoke, dry-run or sampled paths cannot prove completion by themselves.
|
|
268
|
+
- Sample provider/interface/page evidence cannot substitute for all-provider/all-interface/all-platform or full-population completion unless the AC explicitly approves it.
|
|
269
|
+
- Full population is `not_in_scope` when it is not explicitly required by Product / Architecture Source and Acceptance Checklist.
|
|
258
270
|
- Any current contradiction downgrades the affected AC and overall status.
|
|
259
271
|
- Scope narrowing in audit does not modify acceptance unless the user approved a revised source/plan/checklist.
|
|
260
272
|
- `out_of_scope_NA` requires explicit reason and source reference; arbitrary prose cannot waive missing evidence.
|
|
@@ -295,6 +307,7 @@ The generated prompt must require Progress Accounting after each Slice Gate, Epo
|
|
|
295
307
|
- AC acceptance completion: AC rows that are `complete` or sourced `out_of_scope_NA` versus acceptance-required AC rows.
|
|
296
308
|
- engineering implementation progress: plan-conformance rows with implemented paths/tests/evidence versus behavior-affecting plan rows.
|
|
297
309
|
- runtime/proof progress: required proof layers by status, not just code landed.
|
|
310
|
+
- system capability progress, representative sample progress, real object coverage and full population operation progress: delivery-boundary progress from state, with full population reported as `not_in_scope` unless explicitly required.
|
|
298
311
|
- workflow overhead: time, artifacts, gate loops, stale-sync cleanup and review burden spent on workflow rather than product proof.
|
|
299
312
|
|
|
300
313
|
Use generated `derived/progress-ledger.md/json` when the task spans multiple slices or agents. The progress ledger is not Context and not proof; it records current counts, gate cadence, next high-value clusters and stale-state cleanup so the executor does not rerun the full final gate after every slice.
|
|
@@ -447,6 +460,7 @@ The local audit is process recovery only. It must not contain completion judgmen
|
|
|
447
460
|
- The prompt must state that Tiny Context gates wrap Superpowers for source authority, conformance and acceptance, but do not redefine or fork Superpowers execution mechanics.
|
|
448
461
|
- The prompt must identify the Superpowers workdir, Product / Architecture Source, Technical Realization Plan, Acceptance Checklist, `task-state.json`, `events.ndjson` and generated `derived/**` paths at the top.
|
|
449
462
|
- The prompt must state that the Technical Realization Plan controls plan conformance, the Product / Architecture Source prevents scope shrinkage and the full checklist controls acceptance.
|
|
463
|
+
- The prompt must state the capability-first delivery boundary: source/plan/AC fields distinguish system capability build, representative sample validation, full population operation and out-of-scope backlog; `scope_conflict_requires_decision` blocks completion; samples or framework-only evidence cannot prove full-population completion unless the AC explicitly allows it.
|
|
450
464
|
- The prompt must state the Authority Model and that state/derived views/validator/auditor artifacts cannot rewrite source, plan or checklist authority.
|
|
451
465
|
- The prompt must require Product Context Delta and Technical Context Delta evaluation before implementation.
|
|
452
466
|
- The prompt must use parent-level Context Delta plus slice-level new durable fact checks.
|
|
@@ -456,6 +470,7 @@ The local audit is process recovery only. It must not contain completion judgmen
|
|
|
456
470
|
- The prompt must prefer 2-4 strongly related missing layers per slice, require missing-layer classification, delta-driven state/derived synchronization, conservative verdict updates and no AC completion before the final gate.
|
|
457
471
|
- The prompt must include Slice Gate, Epoch Gate and Final Gate cadence; it must say not to run the full final gate after every slice.
|
|
458
472
|
- The prompt must include Progress Accounting for AC acceptance completion, engineering implementation progress, runtime/proof progress and workflow overhead.
|
|
473
|
+
- The prompt must include delivery progress for system capability, representative samples, real object coverage and full population operation, with full population `not_in_scope` unless explicitly required.
|
|
459
474
|
- The prompt must include the progress-ledger.md/json path, artifact budget, proof-layer milestone statuses, workflow overhead backpressure and Next 3-5 high-value clusters.
|
|
460
475
|
- The prompt must mention provider/browser/runtime/security epoch batching and generated active-count markers for final-verdict Markdown.
|
|
461
476
|
- The prompt must include stale/overclaim scan, related-runtime reuse with unique proof prefixes and cleanup count/assertion, and the fixed auditor checklist.
|
|
@@ -489,7 +504,7 @@ Superpowers 输入包:
|
|
|
489
504
|
- Acceptance Checklist:最高验收标准;每个 AC 都要进 final verdict
|
|
490
505
|
- task-state:唯一执行状态;local audit/matrix/verdict/progress ledger 都是 generated views,不能裁判完成
|
|
491
506
|
- Context/tests/core paths:执行前读取,把 plan/AC gap 绑定到测试、API/UI/runtime/browser 证据
|
|
492
|
-
权威:source 管 scope,plan 管施工,checklist 管验收;state/derived/validator/auditor 不能改写它们。Proof index/evidence ledger 是 generated execution index;complete 行必须经 task-state.evidence[]/evidence_id 追溯 fresh evidence。
|
|
507
|
+
权威:source 管 scope,plan 管施工,checklist 管验收;state/derived/validator/auditor 不能改写它们。Capability-first 字段区分 system capability、representative samples、full population、backlog;scope_conflict_requires_decision 阻塞完成。Proof index/evidence ledger 是 generated execution index;complete 行必须经 task-state.evidence[]/evidence_id 追溯 fresh evidence。
|
|
493
508
|
Goal mode:实现/执行目标只在 final-gate 计算 product_goal_complete=true 时完成;只读审计目标可在 audit_task_complete 时结束,但若 verdict 非 accepted/complete,必须写“Audit workflow completed; acceptance target not complete.”并列数量;不得写 Goal achieved 或把 update_goal complete 当用户目标完成。
|
|
494
509
|
|
|
495
510
|
执行顺序:
|
|
@@ -505,40 +520,41 @@ Goal mode:实现/执行目标只在 final-gate 计算 product_goal_complete=tr
|
|
|
505
520
|
10. Final gate 固定为 derive all views -> verification-before-completion -> validate-superpowers-state -> validate-plan-acceptance -> read-only auditor -> stale/overclaim scan -> superpowers final-gate;auditor summary 不是 proof。若审计后改 state/evidence,rerun derive plus both validators。
|
|
506
521
|
|
|
507
522
|
权限/卡点:在当前平台/仓库/工具/用户已授权权限内最大自主推进;先打开相关 app/浏览器页面/CLI/系统设置,复用已有登录态/授权会话/凭据链;已授权 sudo/gsudo/admin elevation 先尝试。只有实际未登录/会话失效/权限不足/需要 MFA 或人工审批、缺账号/真实环境/敏感字段时才暂停,并给最小用户执行清单(页面/系统、字段位置、脱敏/勿发值、拿到后下一步)。
|
|
508
|
-
禁止完成于:local audit、subagent summary、final card
|
|
523
|
+
禁止完成于:local audit、subagent summary、final card、只改代码/计划、只跑部分测试、旧/部分/抽样证据、framework-only 当全量、sample provider/interface/page 当 all-provider/all-interface/all-platform/full population、缺 required layer、material drift、未批准 sibling substitution、runtime 未演练、artifact 未 accepted、API/UI 未 reflected、未批准 scope narrowing、任何 API/UI/data/runtime/test 矛盾。
|
|
509
524
|
```
|
|
510
525
|
|
|
511
526
|
Recommended compact English prompt shape:
|
|
512
527
|
|
|
513
528
|
```text
|
|
514
529
|
Workdir: tmp/ty-context/plan-acceptance/<plan-slug>
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
530
|
+
Source: <workdir>/product-architecture-source.md (scope)
|
|
531
|
+
Plan: <workdir>/technical-realization-plan.md (blueprint)
|
|
532
|
+
Checklist: <workdir>/acceptance-checklist.md (authority)
|
|
533
|
+
State: <workdir>/task-state.json (only execution state)
|
|
519
534
|
Events: <workdir>/events.ndjson (append-only)
|
|
520
|
-
|
|
535
|
+
Views: <workdir>/derived/local-audit.md, plan-conformance-matrix.*, final-acceptance-verdict.*, progress-ledger.*
|
|
521
536
|
You may use multiple agents; if agent slots run low, close idle or unnecessary agents.
|
|
522
537
|
Tiny Context adapter for Superpowers; aligned to official skills, not upstream schema. TC gates cover authority/conformance/acceptance, not Superpowers mechanics.
|
|
523
538
|
Superpowers input packet:
|
|
524
|
-
- Source guards scope; plan controls matrix; checklist controls verdict; task-state
|
|
539
|
+
- Source guards scope; plan controls matrix; checklist controls verdict; task-state is execution state and derived views are generated only.
|
|
525
540
|
- Read Context/tests first; map gaps to test/API/UI/runtime/browser evidence.
|
|
526
|
-
Authority: source/plan/checklist own scope/
|
|
541
|
+
Authority: source/plan/checklist own scope/plan/acceptance; state/derived/validator/auditor cannot rewrite. Complete rows need task-state.evidence[]/evidence_id. Goal mode: implementation/execution complete only when final-gate computes product_goal_complete=true. Read-only audit may end at audit_task_complete; non-accepted verdict says "Audit workflow completed; acceptance target not complete."; no bare "Goal achieved" or update_goal complete.
|
|
542
|
+
Delivery scope: source/plan/AC distinguish capability, samples, full population and backlog; scope_conflict_requires_decision blocks. Samples/framework-only evidence cannot prove full population unless AC allows.
|
|
527
543
|
|
|
528
544
|
Execution order:
|
|
529
|
-
1. Read inputs
|
|
530
|
-
2.
|
|
531
|
-
3. Check
|
|
532
|
-
4. Init/compile task-state.json; TRP was
|
|
533
|
-
5. Prefer superpowers:subagent-driven-development with subagents;
|
|
534
|
-
6. Plan/AC behavior gap -> superpowers:test-driven-development: write
|
|
535
|
-
7. Batch
|
|
545
|
+
1. Read inputs/Context. Task Contract: Product Context Delta none|required; Technical Context Delta none|required; any required -> Context Delta required. Not a validator gate.
|
|
546
|
+
2. Parent Context Delta runs once; slices inherit and record new durable fact yes/no. If required, update owning project_context/** or DESIGN.md; never store generated views/logs/screenshots as Context.
|
|
547
|
+
3. Check plan covers source; if only product plan exists, stop with missing Technical Realization Plan.
|
|
548
|
+
4. Init/compile task-state.json; TRP was validated, so bind directly.
|
|
549
|
+
5. Prefer superpowers:subagent-driven-development with subagents; else superpowers:executing-plans.
|
|
550
|
+
6. Plan/AC behavior gap -> superpowers:test-driven-development: write failing test, observe failure, implement minimally.
|
|
551
|
+
7. Batch 2-4 related missing layers sharing AC/runtime/proof path; single-gap only for blocker/contradiction/metadata. Classify gaps, write slice-delta.json, apply, derive; no AC complete before final gate.
|
|
536
552
|
8. Plan Conformance Gate: tests do not prove conformance; sampled path is not full implementation; each behavior item needs code/API/UI/runtime/test/evidence trace.
|
|
537
553
|
9. Acceptance Evidence Gate: checklist controls verdict; each AC records proof chain, fresh evidence, missing layers, drift and substitution. Current contradictions override old passes.
|
|
538
|
-
10. Final gate: derive all
|
|
554
|
+
10. Final gate: derive all -> verification-before-completion -> validate-superpowers-state -> validate-plan-acceptance -> auditor -> stale/overclaim scan -> superpowers final-gate. Auditor summary is not proof; rerun derive plus both validators after changes.
|
|
539
555
|
|
|
540
|
-
Autonomy/blockers: self-serve under current permissions. Open app/browser/CLI/settings and reuse sessions/auth/helpers. Try authorized sudo/gsudo/admin. Pause only after missing login/session expiry/denied permission/MFA/approval
|
|
541
|
-
Never complete on:
|
|
556
|
+
Autonomy/blockers: self-serve under current permissions. Open app/browser/CLI/settings and reuse sessions/auth/helpers. Try authorized sudo/gsudo/admin. Pause only after missing login/session expiry/denied permission/MFA/approval; give page/system/field.
|
|
557
|
+
Never complete on: audit/summary/final card, code/plan-only, partial/stale/sampled evidence, framework-only population proof, sample-as-full, missing layer, material drift, unapproved substitution/scope narrowing, unexercised runtime, unaccepted artifact, API/UI not reflected, missing validator pass or current API/UI/data/runtime/test contradiction.
|
|
542
558
|
```
|
|
543
559
|
|
|
544
560
|
Before final response, check the prompt length. If it exceeds 3850 characters, tighten wording while preserving paths, input roles, official Superpowers skill names, Product Context Delta, Technical Context Delta, plan-conformance matrix, final verdict, state machine, UI gate, blockers and invalid evidence.
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
+
export declare function compileSuperpowersTask(workdir: string): Promise<SuperpowersTaskState>;
|
|
3
|
+
export declare function computeScopeConflicts(state: SuperpowersTaskState): string[];
|
|
@@ -7,8 +7,13 @@ const DEFAULT_LAYERS = ["code", "test"];
|
|
|
7
7
|
export async function compileSuperpowersTask(workdir) {
|
|
8
8
|
const state = await loadSuperpowersState(workdir);
|
|
9
9
|
await refreshSourceHashes(workdir, state);
|
|
10
|
+
const productSource = await readText(path.join(workdir, state.sources.product_architecture_source.path));
|
|
10
11
|
const technicalPlan = await readText(path.join(workdir, state.sources.technical_realization_plan.path));
|
|
11
12
|
const checklist = await readText(path.join(workdir, state.sources.acceptance_checklist.path));
|
|
13
|
+
state.delivery = {
|
|
14
|
+
product_architecture_scope: parseProductArchitectureScope(productSource),
|
|
15
|
+
scope_conflicts: []
|
|
16
|
+
};
|
|
12
17
|
const planItems = parsePlanItems(technicalPlan);
|
|
13
18
|
const acceptanceCriteria = parseAcceptanceCriteria(checklist);
|
|
14
19
|
const acIds = Object.keys(acceptanceCriteria);
|
|
@@ -32,6 +37,8 @@ export async function compileSuperpowersTask(workdir) {
|
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
state.graph.edges = Object.entries(planItems).flatMap(([planId, item]) => item.related_acs.map((acId) => ({ from: planId, to: acId, type: "supports" })));
|
|
40
|
+
state.delivery.scope_conflicts = computeScopeConflicts(state);
|
|
41
|
+
state.progress = compileProgress(state);
|
|
35
42
|
recomputeStatuses(state);
|
|
36
43
|
await saveSuperpowersState(workdir, state);
|
|
37
44
|
await appendSuperpowersEvent(workdir, "graph_compiled", {
|
|
@@ -40,6 +47,15 @@ export async function compileSuperpowersTask(workdir) {
|
|
|
40
47
|
});
|
|
41
48
|
return state;
|
|
42
49
|
}
|
|
50
|
+
function parseProductArchitectureScope(content) {
|
|
51
|
+
return {
|
|
52
|
+
delivery_scope: fieldText(content, "delivery_scope"),
|
|
53
|
+
full_population_required: fieldBoolean(content, "full_population_required"),
|
|
54
|
+
representative_samples_validate: field(content, "representative_samples_validate"),
|
|
55
|
+
representative_samples_do_not_validate: field(content, "representative_samples_do_not_validate"),
|
|
56
|
+
out_of_scope_backlog: field(content, "out_of_scope_backlog")
|
|
57
|
+
};
|
|
58
|
+
}
|
|
43
59
|
function parsePlanItems(content) {
|
|
44
60
|
const items = {};
|
|
45
61
|
const matches = [...content.matchAll(/\b(PI-\d{3,})\b\s*[:.-]?\s*([^\n]*)/gi)];
|
|
@@ -48,6 +64,11 @@ function parsePlanItems(content) {
|
|
|
48
64
|
const block = blockAfter(content, match.index ?? 0, matches[index + 1]?.index);
|
|
49
65
|
items[id] = {
|
|
50
66
|
requirement: cleanText(match[2]) || firstLine(block) || id,
|
|
67
|
+
delivery_scope: fieldText(block, "delivery_scope"),
|
|
68
|
+
capability_target: fieldText(block, "capability_target"),
|
|
69
|
+
representative_samples: field(block, "representative_samples"),
|
|
70
|
+
full_population_boundary: fieldText(block, "full_population_boundary"),
|
|
71
|
+
non_required_population: field(block, "non_required_population"),
|
|
51
72
|
owner_surfaces: field(block, "owner_surfaces"),
|
|
52
73
|
forbidden_surfaces: field(block, "forbidden_surfaces"),
|
|
53
74
|
implementation_paths: field(block, "implementation_paths"),
|
|
@@ -60,6 +81,11 @@ function parsePlanItems(content) {
|
|
|
60
81
|
if (Object.keys(items).length === 0) {
|
|
61
82
|
items["PI-001"] = {
|
|
62
83
|
requirement: firstLine(content) || "Implement technical realization plan",
|
|
84
|
+
delivery_scope: "",
|
|
85
|
+
capability_target: "",
|
|
86
|
+
representative_samples: [],
|
|
87
|
+
full_population_boundary: "",
|
|
88
|
+
non_required_population: [],
|
|
63
89
|
owner_surfaces: [],
|
|
64
90
|
forbidden_surfaces: [],
|
|
65
91
|
implementation_paths: [],
|
|
@@ -80,6 +106,11 @@ function parseAcceptanceCriteria(content) {
|
|
|
80
106
|
const layers = field(block, "required_proof_layers").map(normalizeLayer).filter(Boolean);
|
|
81
107
|
items[id] = {
|
|
82
108
|
scope: cleanText(match[2]) || firstLine(block) || id,
|
|
109
|
+
acceptance_scope: fieldText(block, "acceptance_scope"),
|
|
110
|
+
ac_validates: field(block, "ac_validates"),
|
|
111
|
+
ac_does_not_validate: field(block, "ac_does_not_validate"),
|
|
112
|
+
sample_boundary: fieldText(block, "sample_boundary"),
|
|
113
|
+
full_population_required: fieldBoolean(block, "full_population_required"),
|
|
83
114
|
related_plan_items: field(block, "related_plan_items").map((item) => item.toUpperCase()),
|
|
84
115
|
required_proof_layers: layers.length > 0 ? layers : DEFAULT_LAYERS,
|
|
85
116
|
status: "not_run"
|
|
@@ -88,6 +119,11 @@ function parseAcceptanceCriteria(content) {
|
|
|
88
119
|
if (Object.keys(items).length === 0) {
|
|
89
120
|
items["AC-001"] = {
|
|
90
121
|
scope: firstLine(content) || "Acceptance checklist item",
|
|
122
|
+
acceptance_scope: "",
|
|
123
|
+
ac_validates: [],
|
|
124
|
+
ac_does_not_validate: [],
|
|
125
|
+
sample_boundary: "",
|
|
126
|
+
full_population_required: null,
|
|
91
127
|
related_plan_items: [],
|
|
92
128
|
required_proof_layers: DEFAULT_LAYERS,
|
|
93
129
|
status: "not_run"
|
|
@@ -95,13 +131,83 @@ function parseAcceptanceCriteria(content) {
|
|
|
95
131
|
}
|
|
96
132
|
return items;
|
|
97
133
|
}
|
|
134
|
+
export function computeScopeConflicts(state) {
|
|
135
|
+
const conflicts = [];
|
|
136
|
+
const product = state.delivery?.product_architecture_scope;
|
|
137
|
+
const productScope = product?.delivery_scope ?? "";
|
|
138
|
+
const productRequiresFullPopulation = productScope === "full_population_operation" || product?.full_population_required === true;
|
|
139
|
+
const productIsCapabilityOnly = productScope === "system_capability_build" ||
|
|
140
|
+
productScope === "representative_sample_validation" ||
|
|
141
|
+
product?.full_population_required === false;
|
|
142
|
+
for (const [planId, item] of Object.entries(state.graph?.plan_items ?? {})) {
|
|
143
|
+
if (productRequiresFullPopulation && item.delivery_scope !== "full_population_operation" && item.delivery_scope !== "out_of_scope_backlog") {
|
|
144
|
+
conflicts.push(`scope_conflict_requires_decision: Product / Architecture Source requires full_population_operation but ${planId} delivery_scope=${item.delivery_scope || "missing"}`);
|
|
145
|
+
}
|
|
146
|
+
if (productIsCapabilityOnly && item.delivery_scope === "full_population_operation" && productScope !== "mixed_scope_requires_boundary") {
|
|
147
|
+
conflicts.push(`scope_conflict_requires_decision: Product / Architecture Source delivery_scope=${productScope || "missing"} but ${planId} delivery_scope=full_population_operation`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
for (const [acId, ac] of Object.entries(state.graph?.acceptance_criteria ?? {})) {
|
|
151
|
+
if (productRequiresFullPopulation && (ac.acceptance_scope === "full_population_not_required" || ac.full_population_required === false)) {
|
|
152
|
+
conflicts.push(`scope_conflict_requires_decision: Product / Architecture Source requires full_population_operation but ${acId} full_population_required=false`);
|
|
153
|
+
}
|
|
154
|
+
if (productIsCapabilityOnly && (ac.acceptance_scope === "full_population_operation" || ac.full_population_required === true) && productScope !== "mixed_scope_requires_boundary") {
|
|
155
|
+
conflicts.push(`scope_conflict_requires_decision: Product / Architecture Source delivery_scope=${productScope || "missing"} but ${acId} acceptance_scope=full_population_operation`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return [...new Set(conflicts)];
|
|
159
|
+
}
|
|
160
|
+
function compileProgress(state) {
|
|
161
|
+
const planEntries = Object.entries(state.graph.plan_items);
|
|
162
|
+
const sampleNames = unique([
|
|
163
|
+
...state.delivery.product_architecture_scope.representative_samples_validate,
|
|
164
|
+
...planEntries.flatMap(([, item]) => item.representative_samples)
|
|
165
|
+
]);
|
|
166
|
+
const systemPlanIds = planEntries.filter(([, item]) => item.delivery_scope === "system_capability_build").map(([planId]) => planId);
|
|
167
|
+
const representativePlanIds = planEntries.filter(([, item]) => item.delivery_scope === "representative_sample_validation").map(([planId]) => planId);
|
|
168
|
+
const fullPopulationRequired = state.delivery.product_architecture_scope.delivery_scope === "full_population_operation" ||
|
|
169
|
+
state.delivery.product_architecture_scope.full_population_required === true ||
|
|
170
|
+
Object.values(state.graph.acceptance_criteria).some((ac) => ac.acceptance_scope === "full_population_operation" || ac.full_population_required === true);
|
|
171
|
+
return {
|
|
172
|
+
system_capability_progress: {
|
|
173
|
+
status: systemPlanIds.length > 0 ? "not_started" : "not_in_scope",
|
|
174
|
+
plan_items: systemPlanIds
|
|
175
|
+
},
|
|
176
|
+
representative_sample_progress: {
|
|
177
|
+
status: sampleNames.length > 0 || representativePlanIds.length > 0 ? "not_started" : "not_in_scope",
|
|
178
|
+
plan_items: representativePlanIds,
|
|
179
|
+
samples: sampleNames
|
|
180
|
+
},
|
|
181
|
+
real_object_coverage: {
|
|
182
|
+
status: sampleNames.length > 0 ? "sampled_only" : "unknown",
|
|
183
|
+
covered_objects: sampleNames
|
|
184
|
+
},
|
|
185
|
+
full_population_operation_progress: {
|
|
186
|
+
status: fullPopulationRequired ? "not_started" : "not_in_scope"
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
98
190
|
function blockAfter(content, start, end) {
|
|
99
191
|
return content.slice(start, end ?? content.length);
|
|
100
192
|
}
|
|
101
193
|
function field(block, name) {
|
|
194
|
+
const text = fieldText(block, name);
|
|
195
|
+
return text ? asStringArray(text) : [];
|
|
196
|
+
}
|
|
197
|
+
function fieldText(block, name) {
|
|
102
198
|
const pattern = new RegExp(`${name}\\s*:\\s*([^\\n]+)`, "i");
|
|
103
199
|
const match = pattern.exec(block);
|
|
104
|
-
return match ?
|
|
200
|
+
return match ? cleanText(match[1]) : "";
|
|
201
|
+
}
|
|
202
|
+
function fieldBoolean(block, name) {
|
|
203
|
+
const value = fieldText(block, name).toLowerCase();
|
|
204
|
+
if (value === "true") {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
if (value === "false") {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
return null;
|
|
105
211
|
}
|
|
106
212
|
function normalizeLayer(value) {
|
|
107
213
|
return value.trim().toLowerCase().replace(/[- ]+/g, "_");
|
|
@@ -112,3 +218,6 @@ function firstLine(content) {
|
|
|
112
218
|
function cleanText(value) {
|
|
113
219
|
return value.replace(/^[-#*\s]+/, "").trim();
|
|
114
220
|
}
|
|
221
|
+
function unique(values) {
|
|
222
|
+
return [...new Set(values.filter(Boolean))];
|
|
223
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SuperpowersTaskState } from "./superpowers-task-state-schema.js";
|
|
2
|
+
export declare function validateDeliveryContract(state: SuperpowersTaskState, errors: string[]): void;
|
|
3
|
+
export declare function validateScopeConflicts(state: SuperpowersTaskState, errors: string[]): void;
|
|
4
|
+
export declare function fullPopulationRequired(state: SuperpowersTaskState): boolean;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { computeScopeConflicts } from "./superpowers-task-compile.js";
|
|
2
|
+
import { isRecord } from "./superpowers-task-state-schema.js";
|
|
3
|
+
const PRODUCT_DELIVERY_SCOPES = new Set([
|
|
4
|
+
"system_capability_build",
|
|
5
|
+
"representative_sample_validation",
|
|
6
|
+
"full_population_operation",
|
|
7
|
+
"mixed_scope_requires_boundary"
|
|
8
|
+
]);
|
|
9
|
+
const PLAN_DELIVERY_SCOPES = new Set([
|
|
10
|
+
"system_capability_build",
|
|
11
|
+
"representative_sample_validation",
|
|
12
|
+
"full_population_operation",
|
|
13
|
+
"out_of_scope_backlog"
|
|
14
|
+
]);
|
|
15
|
+
const ACCEPTANCE_SCOPES = new Set([
|
|
16
|
+
"system_capability_build",
|
|
17
|
+
"representative_sample_validation",
|
|
18
|
+
"full_population_operation",
|
|
19
|
+
"full_population_not_required"
|
|
20
|
+
]);
|
|
21
|
+
export function validateDeliveryContract(state, errors) {
|
|
22
|
+
const product = state.delivery?.product_architecture_scope;
|
|
23
|
+
if (!isRecord(product)) {
|
|
24
|
+
errors.push("Product / Architecture Source delivery scope is missing");
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
requireEnum(errors, "Product / Architecture Source delivery_scope", product.delivery_scope, PRODUCT_DELIVERY_SCOPES);
|
|
28
|
+
requireBoolean(errors, "Product / Architecture Source full_population_required", product.full_population_required);
|
|
29
|
+
requireArray(errors, "Product / Architecture Source representative_samples_validate", product.representative_samples_validate);
|
|
30
|
+
requireArray(errors, "Product / Architecture Source representative_samples_do_not_validate", product.representative_samples_do_not_validate);
|
|
31
|
+
requireArray(errors, "Product / Architecture Source out_of_scope_backlog", product.out_of_scope_backlog);
|
|
32
|
+
}
|
|
33
|
+
for (const [planId, item] of Object.entries(state.graph?.plan_items ?? {})) {
|
|
34
|
+
requireEnum(errors, `${planId} delivery_scope`, item.delivery_scope, PLAN_DELIVERY_SCOPES);
|
|
35
|
+
requireText(errors, `${planId} capability_target`, item.capability_target);
|
|
36
|
+
requireArray(errors, `${planId} representative_samples`, item.representative_samples);
|
|
37
|
+
requireText(errors, `${planId} full_population_boundary`, item.full_population_boundary);
|
|
38
|
+
requireArray(errors, `${planId} non_required_population`, item.non_required_population);
|
|
39
|
+
}
|
|
40
|
+
for (const [acId, ac] of Object.entries(state.graph?.acceptance_criteria ?? {})) {
|
|
41
|
+
requireEnum(errors, `${acId} acceptance_scope`, ac.acceptance_scope, ACCEPTANCE_SCOPES);
|
|
42
|
+
requireArray(errors, `${acId} ac_validates`, ac.ac_validates);
|
|
43
|
+
requireArray(errors, `${acId} ac_does_not_validate`, ac.ac_does_not_validate);
|
|
44
|
+
requireText(errors, `${acId} sample_boundary`, ac.sample_boundary);
|
|
45
|
+
requireBoolean(errors, `${acId} full_population_required`, ac.full_population_required);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function validateScopeConflicts(state, errors) {
|
|
49
|
+
const conflicts = [...new Set([...(state.delivery?.scope_conflicts ?? []), ...computeScopeConflicts(state)])].filter(Boolean);
|
|
50
|
+
for (const conflict of conflicts) {
|
|
51
|
+
if (/scope_conflict_requires_decision/i.test(conflict)) {
|
|
52
|
+
errors.push(conflict);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function fullPopulationRequired(state) {
|
|
57
|
+
return (state.delivery?.product_architecture_scope?.delivery_scope === "full_population_operation" ||
|
|
58
|
+
state.delivery?.product_architecture_scope?.full_population_required === true ||
|
|
59
|
+
Object.values(state.graph?.acceptance_criteria ?? {}).some((ac) => ac.acceptance_scope === "full_population_operation" || ac.full_population_required === true));
|
|
60
|
+
}
|
|
61
|
+
function requireEnum(errors, label, value, allowed) {
|
|
62
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
63
|
+
errors.push(`${label} is missing`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!allowed.has(value)) {
|
|
67
|
+
errors.push(`${label} has unknown value: ${value}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function requireText(errors, label, value) {
|
|
71
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
72
|
+
errors.push(`${label} is missing`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function requireBoolean(errors, label, value) {
|
|
76
|
+
if (typeof value !== "boolean") {
|
|
77
|
+
errors.push(`${label} must be true or false`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function requireArray(errors, label, value) {
|
|
81
|
+
if (!Array.isArray(value)) {
|
|
82
|
+
errors.push(`${label} is missing`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -30,6 +30,11 @@ export function deriveObjects(state) {
|
|
|
30
30
|
plan_requirement: item.requirement,
|
|
31
31
|
acceptance_ids: relatedAcs,
|
|
32
32
|
status: missingLayers.length === 0 && requiredLayers.length > 0 ? "complete" : evidenceIds.length > 0 ? "partial" : item.status,
|
|
33
|
+
delivery_scope: item.delivery_scope,
|
|
34
|
+
capability_target: item.capability_target,
|
|
35
|
+
representative_samples: item.representative_samples,
|
|
36
|
+
full_population_boundary: item.full_population_boundary,
|
|
37
|
+
non_required_population: item.non_required_population,
|
|
33
38
|
conformance_type: item.owner_surfaces.length > 0 ? "product_surface" : "implementation",
|
|
34
39
|
owner_surface: item.owner_surfaces[0] ?? "",
|
|
35
40
|
forbidden_primary_surfaces: item.forbidden_surfaces,
|
|
@@ -60,6 +65,12 @@ export function deriveObjects(state) {
|
|
|
60
65
|
ac_id: acId,
|
|
61
66
|
related_plan_item_ids: ac.related_plan_items,
|
|
62
67
|
status,
|
|
68
|
+
acceptance_scope: ac.acceptance_scope,
|
|
69
|
+
ac_validates: ac.ac_validates,
|
|
70
|
+
ac_does_not_validate: ac.ac_does_not_validate,
|
|
71
|
+
sample_boundary: ac.sample_boundary,
|
|
72
|
+
full_population_required: ac.full_population_required,
|
|
73
|
+
full_population_status: ac.full_population_required === true || ac.acceptance_scope === "full_population_operation" ? status : "not_in_scope",
|
|
63
74
|
required_evidence: requiredLayers,
|
|
64
75
|
required_proof_chain: requiredLayers,
|
|
65
76
|
fresh_evidence: evidenceText(state, evidenceIds),
|
|
@@ -76,6 +87,7 @@ export function deriveObjects(state) {
|
|
|
76
87
|
});
|
|
77
88
|
const allComplete = verdictRows.length > 0 && verdictRows.every((row) => row.status === "complete");
|
|
78
89
|
const progress = {
|
|
90
|
+
...state.progress,
|
|
79
91
|
complete_count: verdictRows.filter((row) => row.status === "complete").length,
|
|
80
92
|
partial_count: verdictRows.filter((row) => row.status === "partial").length,
|
|
81
93
|
acceptance_required_count: verdictRows.filter((row) => row.status !== "out_of_scope_NA").length,
|
|
@@ -4,7 +4,7 @@ export declare const SUPERPOWERS_TASK_STATE_JSON_SCHEMA: {
|
|
|
4
4
|
readonly $id: "https://project-tiny-context-harness.local/superpowers-task-state.schema.json";
|
|
5
5
|
readonly title: "Superpowers Long-Task State";
|
|
6
6
|
readonly type: "object";
|
|
7
|
-
readonly required: readonly ["meta", "sources", "context", "graph", "slices", "evidence", "gates", "progress", "blockers", "final"];
|
|
7
|
+
readonly required: readonly ["meta", "sources", "context", "delivery", "graph", "slices", "evidence", "gates", "progress", "blockers", "final"];
|
|
8
8
|
readonly properties: {
|
|
9
9
|
readonly meta: {
|
|
10
10
|
readonly type: "object";
|
|
@@ -27,6 +27,9 @@ export declare const SUPERPOWERS_TASK_STATE_JSON_SCHEMA: {
|
|
|
27
27
|
readonly context: {
|
|
28
28
|
readonly type: "object";
|
|
29
29
|
};
|
|
30
|
+
readonly delivery: {
|
|
31
|
+
readonly type: "object";
|
|
32
|
+
};
|
|
30
33
|
readonly graph: {
|
|
31
34
|
readonly type: "object";
|
|
32
35
|
};
|
|
@@ -53,6 +56,9 @@ export declare const SUPERPOWERS_TASK_STATE_JSON_SCHEMA: {
|
|
|
53
56
|
export type SuperpowersProofLayerStatus = "missing" | "satisfied" | "invalidated" | "blocked";
|
|
54
57
|
export type SuperpowersPlanItemStatus = "not_started" | "complete" | "partial" | "sampled_only" | "not_implemented" | "blocked" | "scope_changed_requires_user_approval" | "contradicted_by_current_state" | "out_of_scope_NA";
|
|
55
58
|
export type SuperpowersAcceptanceStatus = "not_run" | "complete" | "partial" | "blocked" | "invalidated" | "out_of_scope_NA";
|
|
59
|
+
export type SuperpowersProductDeliveryScope = "system_capability_build" | "representative_sample_validation" | "full_population_operation" | "mixed_scope_requires_boundary";
|
|
60
|
+
export type SuperpowersPlanDeliveryScope = "system_capability_build" | "representative_sample_validation" | "full_population_operation" | "out_of_scope_backlog";
|
|
61
|
+
export type SuperpowersAcceptanceScope = "system_capability_build" | "representative_sample_validation" | "full_population_operation" | "full_population_not_required";
|
|
56
62
|
export interface SuperpowersTaskState {
|
|
57
63
|
meta: {
|
|
58
64
|
task_id: string;
|
|
@@ -72,6 +78,7 @@ export interface SuperpowersTaskState {
|
|
|
72
78
|
source_to_context_coverage: Record<string, unknown>[];
|
|
73
79
|
context_to_implementation_binding: Record<string, unknown>[];
|
|
74
80
|
};
|
|
81
|
+
delivery: SuperpowersDeliveryState;
|
|
75
82
|
graph: {
|
|
76
83
|
plan_items: Record<string, SuperpowersPlanItem>;
|
|
77
84
|
acceptance_criteria: Record<string, SuperpowersAcceptanceCriterion>;
|
|
@@ -81,7 +88,7 @@ export interface SuperpowersTaskState {
|
|
|
81
88
|
slices: SuperpowersSliceRecord[];
|
|
82
89
|
evidence: SuperpowersEvidenceRecord[];
|
|
83
90
|
gates: Record<string, unknown>;
|
|
84
|
-
progress:
|
|
91
|
+
progress: SuperpowersProgressState;
|
|
85
92
|
blockers: unknown[];
|
|
86
93
|
final: {
|
|
87
94
|
product_goal_complete: boolean;
|
|
@@ -95,8 +102,31 @@ export interface SuperpowersSourceRecord {
|
|
|
95
102
|
sha256: string;
|
|
96
103
|
authority: string;
|
|
97
104
|
}
|
|
105
|
+
export interface SuperpowersDeliveryState {
|
|
106
|
+
product_architecture_scope: SuperpowersProductArchitectureScope;
|
|
107
|
+
scope_conflicts: string[];
|
|
108
|
+
}
|
|
109
|
+
export interface SuperpowersProductArchitectureScope {
|
|
110
|
+
delivery_scope: SuperpowersProductDeliveryScope | "";
|
|
111
|
+
full_population_required: boolean | null;
|
|
112
|
+
representative_samples_validate: string[];
|
|
113
|
+
representative_samples_do_not_validate: string[];
|
|
114
|
+
out_of_scope_backlog: string[];
|
|
115
|
+
}
|
|
116
|
+
export interface SuperpowersProgressState {
|
|
117
|
+
system_capability_progress: Record<string, unknown>;
|
|
118
|
+
representative_sample_progress: Record<string, unknown>;
|
|
119
|
+
real_object_coverage: Record<string, unknown>;
|
|
120
|
+
full_population_operation_progress: Record<string, unknown>;
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}
|
|
98
123
|
export interface SuperpowersPlanItem {
|
|
99
124
|
requirement: string;
|
|
125
|
+
delivery_scope: SuperpowersPlanDeliveryScope | "";
|
|
126
|
+
capability_target: string;
|
|
127
|
+
representative_samples: string[];
|
|
128
|
+
full_population_boundary: string;
|
|
129
|
+
non_required_population: string[];
|
|
100
130
|
owner_surfaces: string[];
|
|
101
131
|
forbidden_surfaces: string[];
|
|
102
132
|
implementation_paths: string[];
|
|
@@ -107,6 +137,11 @@ export interface SuperpowersPlanItem {
|
|
|
107
137
|
}
|
|
108
138
|
export interface SuperpowersAcceptanceCriterion {
|
|
109
139
|
scope: string;
|
|
140
|
+
acceptance_scope: SuperpowersAcceptanceScope | "";
|
|
141
|
+
ac_validates: string[];
|
|
142
|
+
ac_does_not_validate: string[];
|
|
143
|
+
sample_boundary: string;
|
|
144
|
+
full_population_required: boolean | null;
|
|
110
145
|
related_plan_items: string[];
|
|
111
146
|
required_proof_layers: string[];
|
|
112
147
|
status: SuperpowersAcceptanceStatus;
|
|
@@ -4,7 +4,7 @@ export const SUPERPOWERS_TASK_STATE_JSON_SCHEMA = {
|
|
|
4
4
|
$id: "https://project-tiny-context-harness.local/superpowers-task-state.schema.json",
|
|
5
5
|
title: "Superpowers Long-Task State",
|
|
6
6
|
type: "object",
|
|
7
|
-
required: ["meta", "sources", "context", "graph", "slices", "evidence", "gates", "progress", "blockers", "final"],
|
|
7
|
+
required: ["meta", "sources", "context", "delivery", "graph", "slices", "evidence", "gates", "progress", "blockers", "final"],
|
|
8
8
|
properties: {
|
|
9
9
|
meta: {
|
|
10
10
|
type: "object",
|
|
@@ -17,6 +17,7 @@ export const SUPERPOWERS_TASK_STATE_JSON_SCHEMA = {
|
|
|
17
17
|
},
|
|
18
18
|
sources: { type: "object" },
|
|
19
19
|
context: { type: "object" },
|
|
20
|
+
delivery: { type: "object" },
|
|
20
21
|
graph: { type: "object" },
|
|
21
22
|
slices: { type: "array" },
|
|
22
23
|
evidence: { type: "array" },
|
|
@@ -10,6 +10,7 @@ export declare function saveSuperpowersState(workdir: string, state: Superpowers
|
|
|
10
10
|
export declare function applySliceDelta(workdir: string, deltaFile: string): Promise<SuperpowersTaskState>;
|
|
11
11
|
export declare function refreshSourceHashes(workdir: string, state: SuperpowersTaskState): Promise<void>;
|
|
12
12
|
export declare function recomputeStatuses(state: SuperpowersTaskState): void;
|
|
13
|
+
export declare function emptyProgressState(): SuperpowersTaskState["progress"];
|
|
13
14
|
export declare function sourceRecords(workdir: string): Promise<SuperpowersTaskState["sources"]>;
|
|
14
15
|
export declare function sha256(value: string): string;
|
|
15
16
|
export declare function stableJson(value: unknown): string;
|
|
@@ -46,6 +46,16 @@ export async function initializeSuperpowersTask(workdir, options = {}) {
|
|
|
46
46
|
source_to_context_coverage: [],
|
|
47
47
|
context_to_implementation_binding: []
|
|
48
48
|
},
|
|
49
|
+
delivery: {
|
|
50
|
+
product_architecture_scope: {
|
|
51
|
+
delivery_scope: "",
|
|
52
|
+
full_population_required: null,
|
|
53
|
+
representative_samples_validate: [],
|
|
54
|
+
representative_samples_do_not_validate: [],
|
|
55
|
+
out_of_scope_backlog: []
|
|
56
|
+
},
|
|
57
|
+
scope_conflicts: []
|
|
58
|
+
},
|
|
49
59
|
graph: {
|
|
50
60
|
plan_items: {},
|
|
51
61
|
acceptance_criteria: {},
|
|
@@ -55,7 +65,7 @@ export async function initializeSuperpowersTask(workdir, options = {}) {
|
|
|
55
65
|
slices: [],
|
|
56
66
|
evidence: [],
|
|
57
67
|
gates: {},
|
|
58
|
-
progress:
|
|
68
|
+
progress: emptyProgressState(),
|
|
59
69
|
blockers: [],
|
|
60
70
|
final: {
|
|
61
71
|
product_goal_complete: false,
|
|
@@ -159,6 +169,14 @@ export function recomputeStatuses(state) {
|
|
|
159
169
|
}
|
|
160
170
|
}
|
|
161
171
|
}
|
|
172
|
+
export function emptyProgressState() {
|
|
173
|
+
return {
|
|
174
|
+
system_capability_progress: { status: "not_started" },
|
|
175
|
+
representative_sample_progress: { status: "not_started" },
|
|
176
|
+
real_object_coverage: { status: "unknown" },
|
|
177
|
+
full_population_operation_progress: { status: "not_in_scope" }
|
|
178
|
+
};
|
|
179
|
+
}
|
|
162
180
|
export async function sourceRecords(workdir) {
|
|
163
181
|
const sources = {};
|
|
164
182
|
for (const [key, source] of Object.entries(SOURCE_FILES)) {
|
|
@@ -3,6 +3,7 @@ import { pathExists, readText } from "./fs.js";
|
|
|
3
3
|
import { findSensitiveEvidence } from "./plan-acceptance-evidence.js";
|
|
4
4
|
import { primitiveText, repoRelative, resolveInputDir } from "./plan-validator-common.js";
|
|
5
5
|
import { derivedMatchesState } from "./superpowers-task-derive.js";
|
|
6
|
+
import { fullPopulationRequired, validateDeliveryContract, validateScopeConflicts } from "./superpowers-task-delivery.js";
|
|
6
7
|
import { loadSuperpowersState, sha256 } from "./superpowers-task-state.js";
|
|
7
8
|
import { isRecord } from "./superpowers-task-state-schema.js";
|
|
8
9
|
export async function validateSuperpowersState(projectRoot, args = []) {
|
|
@@ -33,7 +34,9 @@ export async function validateSuperpowersState(projectRoot, args = []) {
|
|
|
33
34
|
return { info, warnings, hygiene, errors };
|
|
34
35
|
}
|
|
35
36
|
await validateSourceHashes(targetDir, state, errors);
|
|
37
|
+
validateDeliveryContract(state, errors);
|
|
36
38
|
validateGraphReferences(state, errors);
|
|
39
|
+
validateScopeConflicts(state, errors);
|
|
37
40
|
validateEvidenceRecords(state, errors);
|
|
38
41
|
validateProofLayers(state, errors);
|
|
39
42
|
validateAuditor(state, errors);
|
|
@@ -62,7 +65,7 @@ function validateShape(state, errors) {
|
|
|
62
65
|
if (state.meta?.schema_version !== "superpowers-task-state-v1") {
|
|
63
66
|
errors.push("task-state.json schema_version must be superpowers-task-state-v1");
|
|
64
67
|
}
|
|
65
|
-
for (const key of ["meta", "sources", "context", "graph", "slices", "evidence", "gates", "progress", "blockers", "final"]) {
|
|
68
|
+
for (const key of ["meta", "sources", "context", "delivery", "graph", "slices", "evidence", "gates", "progress", "blockers", "final"]) {
|
|
66
69
|
if (!(key in state)) {
|
|
67
70
|
errors.push(`task-state.json is missing section: ${key}`);
|
|
68
71
|
}
|
|
@@ -73,6 +76,7 @@ function hasUsableShape(state) {
|
|
|
73
76
|
return (isRecord(candidate.meta) &&
|
|
74
77
|
isRecord(candidate.sources) &&
|
|
75
78
|
isRecord(candidate.context) &&
|
|
79
|
+
isRecord(candidate.delivery) &&
|
|
76
80
|
isRecord(candidate.graph) &&
|
|
77
81
|
isRecord(candidate.graph.plan_items) &&
|
|
78
82
|
isRecord(candidate.graph.acceptance_criteria) &&
|
|
@@ -217,6 +221,14 @@ function validateFinalCompletion(state, errors) {
|
|
|
217
221
|
errors.push("product_goal_complete=true but Context Delta coverage is unresolved");
|
|
218
222
|
}
|
|
219
223
|
}
|
|
224
|
+
if (fullPopulationRequired(state)) {
|
|
225
|
+
const sampleOnlyEvidence = state.evidence.filter((evidence) => evidence.does_not_prove.some((claim) => /\b(full[-_ ]?population|all[-_ ]?provider|all[-_ ]?interface|all[-_ ]?platform)\b/i.test(claim)));
|
|
226
|
+
if (sampleOnlyEvidence.length > 0) {
|
|
227
|
+
errors.push(`product_goal_complete=true but full-population completion relies on evidence that explicitly does not prove full population coverage: ${sampleOnlyEvidence
|
|
228
|
+
.map((evidence) => evidence.evidence_id)
|
|
229
|
+
.join(", ")}`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
220
232
|
}
|
|
221
233
|
export function allCompletionConditionsSatisfied(state) {
|
|
222
234
|
const errors = [];
|
|
@@ -224,6 +236,8 @@ export function allCompletionConditionsSatisfied(state) {
|
|
|
224
236
|
if (!hasUsableShape(state)) {
|
|
225
237
|
return false;
|
|
226
238
|
}
|
|
239
|
+
validateDeliveryContract(state, errors);
|
|
240
|
+
validateScopeConflicts(state, errors);
|
|
227
241
|
validateGraphReferences(state, errors);
|
|
228
242
|
validateEvidenceRecords(state, errors);
|
|
229
243
|
validateProofLayers(state, errors);
|
package/package.json
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "project-tiny-context-harness",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Minimal project memory and validation harness for AI coding agents.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Seven128",
|
|
7
|
-
"homepage": "https://github.com/Seven128/project-tiny-context-harness#readme",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/Seven128/project-tiny-context-harness.git",
|
|
11
|
-
"directory": "packages/ty-context"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/Seven128/project-tiny-context-harness/issues"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"ai-agents",
|
|
18
|
-
"coding-agent",
|
|
19
|
-
"codex",
|
|
20
|
-
"claude-code",
|
|
21
|
-
"cursor",
|
|
22
|
-
"gemini-cli",
|
|
23
|
-
"opencode",
|
|
24
|
-
"agent-context",
|
|
25
|
-
"context-engineering",
|
|
26
|
-
"context-management",
|
|
27
|
-
"agents-md",
|
|
28
|
-
"project-memory",
|
|
29
|
-
"agent-memory",
|
|
30
|
-
"ai-coding",
|
|
31
|
-
"multi-agent",
|
|
32
|
-
"llm",
|
|
33
|
-
"developer-tools",
|
|
34
|
-
"developer-productivity",
|
|
35
|
-
"cli",
|
|
36
|
-
"ty-context",
|
|
37
|
-
"workflow"
|
|
38
|
-
],
|
|
39
|
-
"type": "module",
|
|
40
|
-
"bin": {
|
|
41
|
-
"ty-context": "dist/cli.js"
|
|
42
|
-
},
|
|
43
|
-
"files": [
|
|
44
|
-
"README.md",
|
|
45
|
-
"dist",
|
|
46
|
-
"assets",
|
|
47
|
-
"migrations",
|
|
48
|
-
"source-mappings.yaml"
|
|
49
|
-
],
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
52
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
-
"test:built": "node --test ../../tests/ty-context/*.test.mjs",
|
|
54
|
-
"test": "npm run build && node --test ../../tests/ty-context/*.test.mjs",
|
|
55
|
-
"prepack": "npm run build"
|
|
56
|
-
},
|
|
57
|
-
"engines": {
|
|
58
|
-
"node": ">=20"
|
|
59
|
-
},
|
|
60
|
-
"dependencies": {
|
|
61
|
-
"@google/design.md": "^0.2.0",
|
|
62
|
-
"impeccable": "^2.3.2",
|
|
63
|
-
"yaml": "^2.9.0"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"@types/node": "^24.0.0",
|
|
67
|
-
"typescript": "^5.5.0"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "project-tiny-context-harness",
|
|
3
|
+
"version": "0.2.78",
|
|
4
|
+
"description": "Minimal project memory and validation harness for AI coding agents.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Seven128",
|
|
7
|
+
"homepage": "https://github.com/Seven128/project-tiny-context-harness#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Seven128/project-tiny-context-harness.git",
|
|
11
|
+
"directory": "packages/ty-context"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Seven128/project-tiny-context-harness/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"coding-agent",
|
|
19
|
+
"codex",
|
|
20
|
+
"claude-code",
|
|
21
|
+
"cursor",
|
|
22
|
+
"gemini-cli",
|
|
23
|
+
"opencode",
|
|
24
|
+
"agent-context",
|
|
25
|
+
"context-engineering",
|
|
26
|
+
"context-management",
|
|
27
|
+
"agents-md",
|
|
28
|
+
"project-memory",
|
|
29
|
+
"agent-memory",
|
|
30
|
+
"ai-coding",
|
|
31
|
+
"multi-agent",
|
|
32
|
+
"llm",
|
|
33
|
+
"developer-tools",
|
|
34
|
+
"developer-productivity",
|
|
35
|
+
"cli",
|
|
36
|
+
"ty-context",
|
|
37
|
+
"workflow"
|
|
38
|
+
],
|
|
39
|
+
"type": "module",
|
|
40
|
+
"bin": {
|
|
41
|
+
"ty-context": "dist/cli.js"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"README.md",
|
|
45
|
+
"dist",
|
|
46
|
+
"assets",
|
|
47
|
+
"migrations",
|
|
48
|
+
"source-mappings.yaml"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"test:built": "node --test ../../tests/ty-context/*.test.mjs",
|
|
54
|
+
"test": "npm run build && node --test ../../tests/ty-context/*.test.mjs",
|
|
55
|
+
"prepack": "npm run build"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=20"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@google/design.md": "^0.2.0",
|
|
62
|
+
"impeccable": "^2.3.2",
|
|
63
|
+
"yaml": "^2.9.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/node": "^24.0.0",
|
|
67
|
+
"typescript": "^5.5.0"
|
|
68
|
+
}
|
|
69
|
+
}
|