project-tiny-context-harness 0.7.2 → 0.7.4
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 +49 -14
- package/assets/README.zh-CN.md +26 -13
- package/assets/agents/AGENTS_CORE.md +5 -5
- package/assets/context_templates/global.md +1 -0
- package/assets/skills/context_development_engineer/SKILL.md +4 -1
- package/assets/skills/context_uiux_design/SKILL.md +19 -6
- package/assets/skills/long-task-workflow/SKILL.md +10 -9
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +7 -5
- package/assets/skills/long-task-workflow/references/contract-authoring.md +24 -6
- package/assets/skills/long-task-workflow/references/evidence-design.md +14 -1
- package/assets/skills/source-plan-authoring/SKILL.md +2 -2
- package/dist/commands/long-task-authoring.js +25 -0
- package/dist/commands/long-task.js +3 -0
- package/dist/lib/design-md.d.ts +3 -0
- package/dist/lib/design-md.js +48 -55
- package/dist/lib/doctor.js +8 -0
- package/dist/lib/long-task-activation-validation.js +13 -2
- package/dist/lib/long-task-authoring-authority-preview.js +1 -0
- package/dist/lib/long-task-authority-material-diff.js +26 -0
- package/dist/lib/long-task-authority-materials.d.ts +2 -2
- package/dist/lib/long-task-authority-materials.js +6 -0
- package/dist/lib/long-task-authority-policy.d.ts +12 -0
- package/dist/lib/long-task-authority-policy.js +9 -0
- package/dist/lib/long-task-authority-revision-analysis.d.ts +33 -0
- package/dist/lib/long-task-authority-revision-analysis.js +91 -0
- package/dist/lib/long-task-authority-revision.js +93 -158
- package/dist/lib/long-task-authority-types.d.ts +7 -0
- package/dist/lib/long-task-authority.js +32 -3
- package/dist/lib/long-task-check-evidence-decoder.d.ts +2 -2
- package/dist/lib/long-task-check-evidence-decoder.js +11 -1
- package/dist/lib/long-task-check-execution-policy.d.ts +3 -0
- package/dist/lib/long-task-check-execution-policy.js +5 -0
- package/dist/lib/long-task-check-runner.js +2 -0
- package/dist/lib/long-task-check-shape.js +33 -3
- package/dist/lib/long-task-conformance-policy.d.ts +5 -0
- package/dist/lib/long-task-conformance-policy.js +35 -0
- package/dist/lib/long-task-contract-types.d.ts +14 -4
- package/dist/lib/long-task-delivery-compiler.js +1 -0
- package/dist/lib/long-task-delivery-parser.js +5 -2
- package/dist/lib/long-task-delivery-types.d.ts +2 -0
- package/dist/lib/long-task-delivery-types.js +2 -0
- package/dist/lib/long-task-delivery-validation.js +11 -0
- package/dist/lib/long-task-evidence-capability-codec.d.ts +2 -0
- package/dist/lib/long-task-evidence-capability-codec.js +231 -0
- package/dist/lib/long-task-evidence-capability-policy.d.ts +8 -0
- package/dist/lib/long-task-evidence-capability-policy.js +147 -0
- package/dist/lib/long-task-evidence-capability-runtime.d.ts +2 -0
- package/dist/lib/long-task-evidence-capability-runtime.js +86 -0
- package/dist/lib/long-task-evidence-capability-types.d.ts +74 -0
- package/dist/lib/long-task-evidence-capability-types.js +1 -0
- package/dist/lib/long-task-evidence-findings.js +5 -1
- package/dist/lib/long-task-evidence-v2.js +38 -23
- package/dist/lib/long-task-final-v2.js +42 -1
- package/dist/lib/long-task-outcome-parser.js +14 -3
- package/dist/lib/long-task-playwright-evidence.d.ts +2 -1
- package/dist/lib/long-task-playwright-evidence.js +70 -2
- package/dist/lib/long-task-progress.js +4 -0
- package/dist/lib/long-task-root-shape.d.ts +1 -0
- package/dist/lib/long-task-root-shape.js +84 -3
- package/dist/lib/long-task-runner-environment.js +1 -1
- package/dist/lib/long-task-runner-freeze.d.ts +2 -2
- package/dist/lib/long-task-runner-freeze.js +3 -1
- package/dist/lib/long-task-runtime-types.d.ts +13 -0
- package/dist/lib/long-task-semantic-contract-types.d.ts +36 -0
- package/dist/lib/long-task-semantic-contract-types.js +1 -0
- package/dist/lib/long-task-semantic-drift-migration.d.ts +3 -0
- package/dist/lib/long-task-semantic-drift-migration.js +68 -0
- package/dist/lib/long-task-shape-primitives.d.ts +3 -0
- package/dist/lib/long-task-shape-primitives.js +25 -0
- package/dist/lib/long-task-stage-policy.d.ts +4 -0
- package/dist/lib/long-task-stage-policy.js +120 -0
- package/dist/lib/long-task-status-projection.d.ts +4 -1
- package/dist/lib/long-task-status-projection.js +63 -3
- package/dist/lib/long-task-status-v2.d.ts +11 -1
- package/dist/lib/long-task-status-v2.js +25 -3
- package/dist/lib/long-task-target-policy.d.ts +6 -0
- package/dist/lib/long-task-target-policy.js +127 -0
- package/dist/lib/migrations.js +29 -0
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +61 -7
- package/migrations/README.md +7 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ npm ci
|
|
|
137
137
|
npm run smoke:quickstart
|
|
138
138
|
npm run preview:pack
|
|
139
139
|
cd /path/to/your/test-repo
|
|
140
|
-
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.7.
|
|
140
|
+
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.7.4.tgz
|
|
141
141
|
npx --no-install ty-context init --adopt
|
|
142
142
|
make validate-context
|
|
143
143
|
```
|
|
@@ -148,7 +148,7 @@ Use this tarball path for source-preview testing, private review or package deve
|
|
|
148
148
|
|
|
149
149
|
The default read path is `project_context/global.md`, `project_context/architecture.md`, `project_context/context.toml`, the default area root, then minimum graph-relevant role Context.
|
|
150
150
|
|
|
151
|
-
Only near-universal recovery facts should use `read_policy = "default"`; specialized detail should be task-triggered `on-demand`. `ty-context doctor` reports the deterministic default Context footprint, soft-budget overages
|
|
151
|
+
Only near-universal recovery facts should use `read_policy = "default"`; specialized detail should be task-triggered `on-demand`. `ty-context doctor` reports the deterministic default Context footprint, soft-budget overages, byte-identical default files and `DESIGN.md` authority status as advisory maintenance signals, not a new gate.
|
|
152
152
|
|
|
153
153
|
### Bounded Context discovery
|
|
154
154
|
|
|
@@ -191,9 +191,11 @@ Newly generated Harness configs default to `strict_except_generated`. Generated/
|
|
|
191
191
|
|
|
192
192
|
### Visual Delivery Guidance
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
The default Workflow performs a conditional Design Authority Check before material production UI. It reads the owning surface Context, `DESIGN.md`, one authored exact token source/generation direction and selected design references. Each reference is `exact-target`, `constraint` or `inspiration`; an unconfigured starter, style-only prose or inspiration does not authorize invented production layout. Explicit design work routes through `context_uiux_design`; ordinary implementation with sufficient authority, local style fixes and throwaway prototypes remain lightweight.
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
For material work, `context_uiux_design` keeps a task-local risk-proportional Visual Coverage Set; durable interaction facts remain in `project_context/**`, durable visual semantics and the design-reference registry remain in `DESIGN.md`, and versioned targets stay at project-native paths. `context_development_engineer` binds that intent to production routes and reports only combinations actually rendered and checked. An implementation screenshot cannot become its own target.
|
|
197
|
+
|
|
198
|
+
An explicit Long-Task resolves missing/conflicting visual authority before Compile, then uses existing Requirement, Control, Assertion, proof-surface, verification-input and `external_confirmation` mechanisms. Browser visual ACs use `ui_browser`; a browser proxy cannot prove an independently failing native target, so native proof remains a project-owned current-execution Check when representable or an external confirmation. Frozen screenshot baselines are verifier inputs, generated screenshots/diffs are review artifacts, and subjective approval remains external. No visual Schema, risk level, lifecycle state, Gate, required design directory or universal pixel threshold is added.
|
|
197
199
|
|
|
198
200
|
### Optional Source Plan Authoring
|
|
199
201
|
|
|
@@ -318,7 +320,7 @@ make validate-harness
|
|
|
318
320
|
|
|
319
321
|
The modularity gate is `ty-context check-modularity`. Scoped waivers require `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
|
|
320
322
|
|
|
321
|
-
The synchronized local preview tarball is named `project-tiny-context-harness-0.7.
|
|
323
|
+
The synchronized local preview tarball is named `project-tiny-context-harness-0.7.4.tgz`.
|
|
322
324
|
|
|
323
325
|
## Community And Further Reading
|
|
324
326
|
|
package/assets/README.md
CHANGED
|
@@ -137,7 +137,7 @@ The smoke packs the local workspace, installs it into a disposable repo and vali
|
|
|
137
137
|
|
|
138
138
|
```sh
|
|
139
139
|
cd /path/to/your/test-repo
|
|
140
|
-
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.7.
|
|
140
|
+
npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.7.4.tgz
|
|
141
141
|
npx --no-install ty-context init --adopt
|
|
142
142
|
make validate-context
|
|
143
143
|
```
|
|
@@ -166,7 +166,7 @@ minimum graph-relevant area/role Context
|
|
|
166
166
|
|
|
167
167
|
Only near-universal recovery facts should use `read_policy = "default"`; specialized architecture, contract, deployment and historical detail should be task-triggered `on-demand` Context. Before deciding `Context Delta`, the Agent also runs one bounded text search over `project_context/**` using a small set of high-signal task terms such as explicit area/module names and API/schema/state/security/verification/deployment language. Matching files are merged with manifest candidates and filtered by semantic relevance. This is not a vector or persistent retrieval system and creates no index, cache, registry, search state or authority.
|
|
168
168
|
|
|
169
|
-
`ty-context doctor` reports the deterministic default read footprint, per-file/total soft-budget overages
|
|
169
|
+
`ty-context doctor` reports the deterministic default read footprint, per-file/total soft-budget overages, byte-identical default files and `DESIGN.md` authority status. These are advisory maintenance signals, not a new validation gate or workflow state.
|
|
170
170
|
|
|
171
171
|
Typical roles are area/domain, contract, foundation, decision-rationale, implementation-index, verification and deployment. Context owns durable intended boundaries; code owns current implementation; tests, CI, browser/runtime evidence and people own behavior and product acceptance.
|
|
172
172
|
|
|
@@ -212,9 +212,11 @@ Newly generated Harness configs default to `strict_except_generated`. Generated/
|
|
|
212
212
|
|
|
213
213
|
### Visual Delivery Guidance
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
The default Workflow now performs a conditional Design Authority Check before material production UI: new/redesigned screens, primary layout/navigation/theme/component-system work, high-fidelity implementation and substantial visual polish. It reads the owning surface Context, `DESIGN.md`, one authored exact token source/generation direction and selected design references. Each reference is `exact-target`, `constraint` or `inspiration`; an unconfigured starter, style-only prose or inspiration does not authorize invented production layout. Explicit design work routes through `context_uiux_design`; ordinary implementation with sufficient authority, local style fixes and throwaway prototypes remain lightweight.
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
For material work, `context_uiux_design` keeps a task-local risk-proportional Visual Coverage Set across production surfaces/components, viewports, themes/modes, states, content stress and accessibility/motion conditions. Durable surface/interaction facts remain in `project_context/**`; durable visual semantics and the design-reference registry remain in `DESIGN.md`; versioned targets stay at project-native paths. `context_development_engineer` binds that intent to production routes and reports only combinations actually rendered and checked. An implementation screenshot cannot become its own target.
|
|
218
|
+
|
|
219
|
+
An explicit Long-Task resolves missing/conflicting visual authority before Compile, then uses existing Requirement, Control, Assertion, proof-surface, verification-input and `external_confirmation` mechanisms. Browser visual ACs use `ui_browser`; a browser proxy cannot prove a native target that can fail independently, so native target proof remains a project-owned current-execution Check when representable or an external confirmation. Frozen screenshot baselines are verifier inputs, generated screenshots/diffs are review artifacts, and subjective approval remains external. This adds no visual Schema, risk level, lifecycle state, Gate, required design directory or universal pixel threshold.
|
|
218
220
|
|
|
219
221
|
### Optional Source Plan Authoring
|
|
220
222
|
|
|
@@ -262,9 +264,13 @@ Later revisions are classified into three paths. Formally monotonic evidence str
|
|
|
262
264
|
|
|
263
265
|
The package-managed Long-Task Skill uses progressive disclosure: its main `SKILL.md` keeps the objective, boundaries and phase routing; one-level references are read only for Contract authoring, evidence design or authority lifecycle. This reduces routine instruction load without moving any rule into a second authority. When Source or controlling Context declares an architecture invariant, the Contract uses existing technical obligations/global constraints/forbidden shortcuts, owner/path/Binding boundaries and a project-owned executable Check. Functional acceptance cannot substitute when the architecture invariant can fail independently.
|
|
264
266
|
|
|
265
|
-
A Draft Outcome is simply an Outcome before Authority Lock. Outcomes split independently observable, decidable and target-verifiable results so the current Goal can keep a smaller dependency-ready working set, target verification, localize failures, resume findings and invalidate stale local results. `depends_on` expresses acceptance readiness; the Rolling Frontier
|
|
267
|
+
A Draft Outcome is simply an Outcome before Authority Lock. Outcomes split independently observable, decidable, vertical and target-verifiable results so the current Goal can keep a smaller dependency-ready working set, target verification, localize failures, resume findings and invalidate stale local results. `depends_on` expresses acceptance readiness. Every Outcome belongs to one ordered Stage; its Stage gate transitively depends on the other Outcomes in that Stage, and later Stages depend on earlier gates. The Rolling Frontier and Stage status are derived from ordinary Outcome Progress and are temporary. An Outcome is not a Worker, scheduler task, queue or parallelism unit, and a Stage owns no Receipt or second Gate. Outcome decomposes execution and diagnosis, not completion authority: targeted passes never replace the one complete Final Gate on the current final snapshot.
|
|
268
|
+
|
|
269
|
+
The Contract declares one bounded target profile, its non-empty required product target refs and each target's runtime family/root entrypoint. A Web/process proxy cannot satisfy an independently required Native/desktop target. Browser target proof uses Playwright; Native/desktop target proof uses a project binary. Every `critical_user_path` Outcome and Stage gate proves `target_runtime` from every required target's root entrypoint; a multi-Outcome Stage gate also proves at least two distinct surfaces share one runtime state.
|
|
270
|
+
|
|
271
|
+
When a declared result can pass on a proxy surface while failing in its target runtime, the earliest owning Outcome declares a project-owned Check that exercises the target during the current Check execution. A tracked report, screenshot, binary, log or historical run cannot be the sole runtime proof. Checks declare keyed Given/When scenarios and journey roles; Assertions declare all-of Evidence Capabilities backed by typed current-execution records. Static `presence` cannot prove behavior, degradation cannot replace required success, fixed-input output cannot prove variation and a producer cannot self-attest its own boundary/external effect. After a blocker-driven semantic/proof revision, only affected weak-observability or high-risk behavioral Claims pay causal review. The Goal runs the live Check after the first runnable slice and, after coalescing related edits, before dependent work grows when declared inputs make Progress stale. This reuses targeted verification and Final Gate: it adds no open-ended `platform_impact` flags, per-platform progress state or alternate Gate, requires no full rebuild per Outcome/edit, never accepts early and is rerun by Final Gate.
|
|
266
272
|
|
|
267
|
-
|
|
273
|
+
A separate read-only Global Product Conformance Check is required only for weak-observability work that also has multiple Stages or multiple required product runtime families. It starts at a required root product target, has independent Raw Execution and runs within the existing Final Gate. Single-Stage, single-family work retains the existing same-Check sensitivity path and pays no extra conformance run.
|
|
268
274
|
|
|
269
275
|
The platform owns physical Goal/session lifecycle. A later session runs `resume` to reconstruct semantic state; Tiny Context does not recreate the prior physical Turn. Machine acceptance covers only `declared_machine_authority` and reports `native_goal_effect: none`. Before completing the platform-native Goal, the Agent performs a veto-only comparison of current Goal/user meaning against accepted marked Source and checks for pending revisions, unresolved blockers or omissions; this guard may block and repair, but it never supplies acceptance proof.
|
|
270
276
|
|
|
@@ -289,14 +295,14 @@ ty-context long-task abandon <workdir> [--force-corrupt-state]
|
|
|
289
295
|
```
|
|
290
296
|
|
|
291
297
|
- `init` creates one Compact inline-Outcome Contract template.
|
|
292
|
-
- `preflight` applies Compact defaults and reports all discoverable Source/REQ/CTRL/OBL/AC, Context, risk, path/binding, runner/input and proof diagnostics. Exact duplicate diagnostics are merged with `occurrences`; known problems may include stable `refs` and a safe `repair_hint` that never weakens authority or invents product semantics. It is read-only: no Authority Lock, marker, cache, progress, Receipt, pending revision, state lock or project Check.
|
|
298
|
+
- `preflight` applies Compact defaults and reports all discoverable Source/REQ/CTRL/OBL/AC, Stage closure, required-target/root/runner, scenario/journey, capability, external-impact, Product Conformance, Context, risk, path/binding, runner/input and proof diagnostics. Exact duplicate diagnostics are merged with `occurrences`; known problems may include stable `refs` and a safe `repair_hint` that never weakens authority or invents product semantics. It is read-only: no Authority Lock, marker, cache, progress, Receipt, pending revision, state lock or project Check.
|
|
293
299
|
- `compile` generates Global plus Outcome Result/Requirement/Control-field/Non-completing/Technical Claims, rejects uncovered Claims, preserves an immutable first baseline and makes the first successful formal Compile the Authority Lock. Every result includes a lifecycle event, `delivery_completed_by_this_event: false`, `native_goal_effect: none` and a next action. The first result also includes `execution_model_checkpoint.required: true`; later Compile results return `required: false`. Every revision compares against active authority regardless of progress, Receipt/cache deletion or implementation restoration. Source/Context/Product/Acceptance/Global/verifier materials, owner/binding authority, resolved runners and verification inputs are frozen in the common-dir Active Authority V3 snapshot; the model-choice result is not stored as Authority state.
|
|
294
300
|
- `diagnose-revision` performs a side-effect-free candidate Compile. Only a scope-only candidate may run existing active Check identities with unchanged runner/verifier authority; semantic changes, proof weakening, runner or verifier-content changes, and risk increases are summarized without runner execution, while risk downgrade is rejected. Output always has `acceptance_authorized: false`, `progress_written: false` and `pending_revision_written: false`.
|
|
295
301
|
- `compile --revise` auto-adopts proven-safe revisions. Protected revisions return `authority_revision_pending` on stdout plus the exact decision id and deterministic material approval summary, then fail closed until `approve-authority-revision` approves that exact id. Candidate edits produce a new id and invalidate the old approval. Adoption emits `authority_revision_adopted` and returns to rolling execution; it never means delivery completion.
|
|
296
302
|
- `verify` writes scoped per-Check Progress Records only after rechecking active task/revision/compiled/worktree identity. A concurrent revision returns `active_authority_changed_during_verify` and writes no stale progress.
|
|
297
|
-
- `status` reports each Outcome as `unverified`, `progress_passing`, `progress_failing`, `progress_stale` or `blocked_external`. It also reports the fresh Final Receipt as `final_workflow_status` (or `null` after drift), the active Contract's complete `external_confirmations` and the single `pending_authority_revision` decision when present. `progress_passing` is targeted repair evidence rather than “Outcome complete”; `progress_stale` is not a current pass, and `final_workflow_status: null` means unfinished. It reads the common-dir authority snapshot and reports a missing or mismatched workdir cache as a repairable diagnostic.
|
|
298
|
-
- `resume` is read-only and reports task identity, risk, relevant Context, Git state, the same Final/external/pending decision surfaces, ready Outcomes, findings and the next safe action from the common-dir authority snapshot.
|
|
299
|
-
- `final-gate` requires a clean candidate commit, recompiles source authority, reruns every required Check on one Git-tree snapshot and rechecks active identity before acceptance.
|
|
303
|
+
- `status` reports each Outcome as `unverified`, `progress_passing`, `progress_failing`, `progress_stale` or `blocked_external`. It derives `stages`, `ready_stages` and the stage-constrained Outcome frontier from current Progress without persisting Stage completion. It also reports the fresh Final Receipt as `final_workflow_status` (or `null` after drift), target profile/state, the active Contract's complete `external_confirmations` and the single `pending_authority_revision` decision when present. `progress_passing` is targeted repair evidence rather than “Outcome complete”; `progress_stale` is not a current pass, and `final_workflow_status: null` means unfinished. It reads the common-dir authority snapshot and reports a missing or mismatched workdir cache as a repairable diagnostic.
|
|
304
|
+
- `resume` is read-only and reports task identity, risk, relevant Context, Git state, the same Final/target/Stage/external/pending decision surfaces, ready Outcomes, findings and the next safe action from the common-dir authority snapshot.
|
|
305
|
+
- `final-gate` requires a clean candidate commit, recompiles source authority, reruns every required Check on one Git-tree snapshot and rechecks active identity before acceptance. Its Receipt derives each Stage as `passed`, `failed`, `blocked_external` or `blocked_dependency`, and derives `target_state` as `not_accepted`, `blocked_external` or the Contract's exact `implementation_complete`, `target_profile_usable` or `production_release_ready` qualification.
|
|
300
306
|
- `stop-check` and `close` run that Live Final Gate themselves. They never trust status, progress, a Receipt or compiled cache for acceptance; success clears only the accepted identity through CAS. Every accepted Stop emits one non-blocking terminal-scope `systemMessage`; external-pending results additionally name all confirmations. Final/Stop/close report `acceptance_scope: declared_machine_authority` and `native_goal_effect: none`; close also reports `closed_scope: machine_authority`. `status: closed` means only that machine Authority was cleared, not that the native Goal or complete external delivery finished.
|
|
301
307
|
- `abandon` is explicit non-success cleanup. `--force-corrupt-state` is reserved for invalid/mismatched/legacy-unrecoverable state or a stale active lock and removes only deterministic local active state plus `<workdir>/.ty-context/**`; Contract, Source, Context and Git content are preserved.
|
|
302
308
|
|
|
@@ -311,6 +317,17 @@ task:
|
|
|
311
317
|
id: example-task
|
|
312
318
|
title: Example task
|
|
313
319
|
goal: Complete observable delivery goal
|
|
320
|
+
target_profile:
|
|
321
|
+
key: personal-trial
|
|
322
|
+
description: The example is usable from its declared runtime root.
|
|
323
|
+
required_state: target_profile_usable
|
|
324
|
+
required_target_refs: [example-runtime]
|
|
325
|
+
execution_targets:
|
|
326
|
+
- key: example-runtime
|
|
327
|
+
description: Example product runtime
|
|
328
|
+
role: product
|
|
329
|
+
runtime_family: process
|
|
330
|
+
root_entrypoint: tests/runtime.mjs
|
|
314
331
|
source_paths: [plans/example.md]
|
|
315
332
|
context_refs: [project_context/areas/main.md]
|
|
316
333
|
source_claims:
|
|
@@ -320,14 +337,22 @@ source_claims:
|
|
|
320
337
|
disposition:
|
|
321
338
|
type: claim
|
|
322
339
|
refs: [observable-outcome.requirement.observable]
|
|
340
|
+
stages:
|
|
341
|
+
- key: delivery
|
|
342
|
+
title: Delivery
|
|
343
|
+
depends_on: []
|
|
344
|
+
gate_outcome: observable-outcome
|
|
323
345
|
risk:
|
|
324
346
|
facts: {}
|
|
325
347
|
global: {}
|
|
326
348
|
outcomes:
|
|
327
349
|
- key: observable-outcome
|
|
328
350
|
title: Observable outcome
|
|
351
|
+
stage: delivery
|
|
329
352
|
product:
|
|
330
353
|
observable_result: What a user or system can observe
|
|
354
|
+
success_path_required: true
|
|
355
|
+
degradation_path_required: false
|
|
331
356
|
owner:
|
|
332
357
|
label: Owning product or module boundary
|
|
333
358
|
context_refs: [project_context/areas/main.md]
|
|
@@ -347,6 +372,11 @@ outcomes:
|
|
|
347
372
|
acceptance:
|
|
348
373
|
checks:
|
|
349
374
|
- key: runtime
|
|
375
|
+
journey_roles: [success, stage_gate]
|
|
376
|
+
execution_target: {target_ref: example-runtime, entrypoint: root}
|
|
377
|
+
scenario:
|
|
378
|
+
given: [{key: source-ready, statement: The planned source carrier is available.}]
|
|
379
|
+
when: [{key: inspect-result, statement: Inspect the result through the declared runtime.}]
|
|
350
380
|
proof_surface: runtime_behavior
|
|
351
381
|
runner:
|
|
352
382
|
type: node_oracle
|
|
@@ -360,6 +390,7 @@ outcomes:
|
|
|
360
390
|
criterion: The declared requirement is observable.
|
|
361
391
|
claims: [result, requirement.observable]
|
|
362
392
|
observation: result
|
|
393
|
+
evidence_capabilities: [state_delta, target_runtime]
|
|
363
394
|
operator: equals
|
|
364
395
|
expected: true
|
|
365
396
|
counterfactual_controls:
|
|
@@ -380,7 +411,7 @@ Global non-goals, constraints and forbidden shortcuts generate `GLOBAL.non_goal.
|
|
|
380
411
|
|
|
381
412
|
Claim-bearing structured Global Checks also declare `global.acceptance.counterfactual_controls`. Each control uses `binding_ref: <outcome-key>.<binding-key>` to reuse an Outcome-owned implementation carrier; no separate Global Binding layer exists. An `existing` mutation target must exist at Preflight/Compile, while a `planned` target may be absent until implementation but must exist at Final Gate and participates in Progress freshness.
|
|
382
413
|
|
|
383
|
-
Supported runners are `package_script`, `project_binary`, `node_oracle` and `playwright_test`. Supported proof surfaces are `ui_browser`, `runtime_behavior`, `api_contract`, `data_state`, `security_boundary`, `population_coverage` and `implementation_structure`.
|
|
414
|
+
Supported runners are `package_script`, `project_binary`, `node_oracle` and `playwright_test`. Supported proof surfaces are `ui_browser`, `runtime_behavior`, `api_contract`, `data_state`, `security_boundary`, `population_coverage` and `implementation_structure`. Execution-target runtime families are the bounded `browser`, `native`, `desktop`, `service`, `process` and `external` set; target roles are `product`, `support` and `observer`. Required target refs resolve only to product targets. Browser target proof requires `playwright_test`; Native/desktop target proof requires `project_binary`.
|
|
384
415
|
|
|
385
416
|
### One Contract And Source Claims
|
|
386
417
|
|
|
@@ -414,11 +445,13 @@ An explicit user request can raise the level to strict. Explicit `standard` belo
|
|
|
414
445
|
|
|
415
446
|
### Evidence And Authority
|
|
416
447
|
|
|
417
|
-
Final acceptance is computed from executable current evidence, not agent prose. Evidence adapters derive from runner kind: `playwright_test` produces `playwright_json_v1` and is the only adapter allowed for `ui_browser`; package scripts, project binaries and Node oracles
|
|
448
|
+
Final acceptance is computed from executable current evidence, not agent prose. Evidence adapters derive from runner kind: `playwright_test` produces `playwright_json_v1` and is the only adapter allowed for `ui_browser`; package scripts, project binaries and Node oracles use the `structured_json_v2` adapter for non-browser surfaces and emit the additive `long-task-check-result-v3` payload when capability records are required. V2 payloads remain decodable only for compatibility and cannot satisfy non-presence capabilities. The adapter is part of acceptance, raw-execution, compiled, progress and Receipt identity.
|
|
449
|
+
|
|
450
|
+
Every Check declares non-empty keyed `scenario.given` and `scenario.when` steps plus one or more roles from `success`, `degradation`, `recovery`, `stage_gate` and `conformance`. Every Assertion declares an all-of set from `presence`, `interaction_trace`, `state_delta`, `cross_surface_consistency`, `durable_readback`, `boundary_invocation`, `external_side_effect`, `failure_injection`, `visual_render`, `target_runtime` and `input_variation`. Except for static `presence`, each capability requires exactly one typed current-execution record bound to that Assertion. Missing, duplicate, unknown or undeclared records fail closed. Result Claims use success Checks only; success and degradation cannot share one Check. External-boundary evidence runs on an observer target. Input variation proves at least two distinct inputs, two output hashes and a failure case.
|
|
418
451
|
|
|
419
452
|
Every Outcome has at least one non-Result atomic Claim, and a Claim is covered only when all `required_proof_surfaces` are covered. Claim-bearing assertions use explicit expected-value comparisons; unary `truthy`/`falsy` are forbidden, and `exists` is limited to `implementation_structure` obligations. Across all Checks sharing one Raw Execution identity, one claim-bearing Observation belongs to one Assertion. Playwright Claim proof has one canonical form: `playwright.case.<ac-key>.passed equals true`. Missing, skipped, flaky, unexpected, failed or duplicate-within-project ACs fail closed; the same AC across distinct Playwright projects aggregates only when every instance passes. Decoder diagnostic fields such as aggregate pass, executed, skipped, status and counts cannot prove Claims.
|
|
420
453
|
|
|
421
|
-
Outcome Counterfactuals bind a local Binding; Global Counterfactuals bind an Outcome-owned `binding_ref`. Both may mutate only a proven subset of carriers. `structured_json_v2`
|
|
454
|
+
Outcome Counterfactuals bind a local Binding; Global Counterfactuals bind an Outcome-owned `binding_ref`. Both may mutate only a proven subset of carriers. `structured_json_v2` adapter executions require completed exit-zero execution with exactly the expected `assertion_value_mismatch` set. A weak `playwright_json_v1` Counterfactual may accept exit one only under exact, complete unexpected-instance accounting; ordinary Playwright Baseline Checks still require exit zero. Standard frozen Playwright content is trusted verifier input. For a `weak_observability` Outcome, every claim-bearing Playwright AC and related Claim needs same-Check sensitivity. Claim and Population proofs are emitted only after the complete Check status is `passed`.
|
|
422
455
|
|
|
423
456
|
Raw Execution identity binds frozen runner identity plus canonical declared Environment Requirements, never actual environment values. A Playwright Test uses `[ac:<assertion-key>]`; one Test may bind at most one declared AC. Every Claim-bearing structured Check needs same-Check, Claim-related Counterfactual sensitivity; unrelated Artifacts or another Check do not count. Counterfactual Findings are projected into their owning Check Result before Progress is written, so status/resume recover the Finding without a new Global Outcome state. Explain traces Source Item → canonical target → Claim or Assertion → required surfaces → Check → adapter → Observation.
|
|
424
457
|
|
|
@@ -432,6 +465,8 @@ Version 0.6.0 retires the V1 schema/runtime and repo-local Hook. Enable, disable
|
|
|
432
465
|
|
|
433
466
|
Version 0.6.0 defines the first public V2 semantics while retaining the `long-task-delivery-v2` schema name and physical `outcome_files` parser form. Optional Source Plan authoring adds no Schema, CLI, Preflight, Compile, Validator, Receipt, Authority or state. Preflight and direct Compile use one activation-safety kernel.
|
|
434
467
|
|
|
468
|
+
Version 0.7.2 strengthens that same V2 authority with ordered Stages, bounded required targets/root entrypoints, explicit success/degradation journeys and scenarios, typed Evidence Capabilities, typed external impact, risk-proportional Product Conformance and terminal target/Stage projections. An older V2 Contract missing those fields reports the indexed manual migration `long-task-v2-semantic-drift-authority`; re-author the missing meaning from Source. Upgrade never infers those semantics or imports old Progress/Receipts as passing evidence.
|
|
469
|
+
|
|
435
470
|
`/normal-long-task` is also a retirement pointer to `/long-task-workflow`; it creates no checklist, prompt, audit, matrix, verdict or second authority.
|
|
436
471
|
|
|
437
472
|
### Package update modes
|
|
@@ -463,7 +498,7 @@ make validate-harness
|
|
|
463
498
|
|
|
464
499
|
The modularity gate is `ty-context check-modularity`. Scoped waivers require `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
|
|
465
500
|
|
|
466
|
-
`npm run preview:pack` produces a local preview named `project-tiny-context-harness-0.7.
|
|
501
|
+
`npm run preview:pack` produces a local preview named `project-tiny-context-harness-0.7.4.tgz` under the preview output directory.
|
|
467
502
|
|
|
468
503
|
## Community And Further Reading
|
|
469
504
|
|
package/assets/README.zh-CN.md
CHANGED
|
@@ -71,7 +71,7 @@ manifest/trigger 命中的少量 area/role Context
|
|
|
71
71
|
|
|
72
72
|
这次搜索只补充语义判断,不会把所有关键词命中都当成 Authority,也不会创建向量/持久索引、缓存、Registry、search state 或第二权威。它仍可能漏掉完全不同的同义词或间接依赖,因此高风险任务还需要 Architecture Context Hit 与收尾 Conformance。
|
|
73
73
|
|
|
74
|
-
`ty-context doctor` 会报告确定性的默认 Context
|
|
74
|
+
`ty-context doctor` 会报告确定性的默认 Context 文件/字节规模、单文件与总量软预算超限、字节完全相同的默认文件,以及 `DESIGN.md` 权威状态。这些只是维护提示,不是新验证 Gate 或运行时状态。
|
|
75
75
|
|
|
76
76
|
Context 负责耐久的意图和边界,代码负责当前实现,测试/CI/浏览器或运行时证据/人工负责行为与产品验收。
|
|
77
77
|
|
|
@@ -105,9 +105,11 @@ Harness 只路由仓库原生 lint/AST/dependency/contract check,不实现跨
|
|
|
105
105
|
|
|
106
106
|
### 视觉交付指导
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
默认 Workflow 现在会在 material production UI 前执行条件式 Design Authority Check,包括新建/重做页面、主要布局/导航/主题/组件体系、高保真实现和大幅 visual polish。它读取 owning surface Context、`DESIGN.md`、唯一 authored token source/generation direction 和选定设计引用。引用分为 `exact-target`、`constraint`、`inspiration`;未配置 starter、只有风格文字或灵感图都不能授权 agent 自行发明生产布局。明确的设计任务路由到 `context_uiux_design`;已有充分权威的普通实现、局部样式修复和 throwaway prototype 仍保持轻量。
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
对 material 工作,`context_uiux_design` 在任务内部维护风险比例化的 Visual Coverage Set;耐久 surface/interaction 事实属于 `project_context/**`,耐久视觉语义和设计引用 registry 属于 `DESIGN.md`,versioned target 保留在项目原生路径。`context_development_engineer` 把这些意图绑定到生产组件/真实 route,只报告真正渲染和检查过的组合;实现截图不能成为它自己的目标。
|
|
111
|
+
|
|
112
|
+
显式 Long-Task 会在 Compile 前解决缺失/冲突的视觉权威,再复用现有 Requirement、Control、Assertion、proof surface、verification input 与 `external_confirmation`。浏览器视觉 AC 使用 `ui_browser`;浏览器代理不能证明可独立失败的原生目标,因此原生 proof 只能使用项目自己的 current-execution target Check,无法真实表达时保留为外部确认。冻结截图 baseline 是 verifier input,生成截图/diff 是 review artifact,主观批准保持外部。这不新增视觉 Schema、risk level、lifecycle state、Gate、必需设计目录或通用像素阈值。
|
|
111
113
|
|
|
112
114
|
### 可选 Source Plan Authoring
|
|
113
115
|
|
|
@@ -167,9 +169,13 @@ Agent 此时在实现前只暂停一次,请用户选择:继续当前模型
|
|
|
167
169
|
|
|
168
170
|
Long-Task Skill 采用渐进读取:主 `SKILL.md` 只保留目标、硬边界和阶段路由,Contract Authoring、Evidence Design 与 Authority Lifecycle 细节只在对应阶段读取一层 reference。这只是指令组织,不产生第二权威。
|
|
169
171
|
|
|
170
|
-
Draft Outcome 只是 Authority Lock 前的 Outcome。Outcome
|
|
172
|
+
Draft Outcome 只是 Authority Lock 前的 Outcome。Outcome 按可独立观察、判断、纵向闭环和定向验证的结果拆分,使当前 Goal 能缩小 dependency-ready 工作集、定向验证、定位失败、恢复 finding 并精确失效旧局部结果。`depends_on` 只表示 acceptance readiness。每个 Outcome 属于一个有序 Stage;Stage gate 传递依赖同 Stage 其余 Outcome,后续 Stage 依赖前置 gate。Rolling Frontier 和 Stage 状态都由普通 Outcome Progress 临时派生;Outcome 不是 Worker、scheduler task、queue 或并行单元,Stage 也没有 Receipt 或第二个 Gate。Outcome 拆分执行和诊断,不拆分完成权威,因此最终仍必须在当前最终快照运行一次完整 Final Gate。
|
|
173
|
+
|
|
174
|
+
Contract 声明一个有界 target profile、非空 required product target refs,以及每个 target 的 runtime family/root entrypoint。Web/process 代理不能代替单独要求的 Native/desktop 目标;browser 目标由 Playwright 证明,Native/desktop 目标由 project binary 证明。每个 `critical_user_path` Outcome 和 Stage gate 都必须从每个 required target 的 root 证明 `target_runtime`;多 Outcome Stage gate 还必须证明至少两个不同 surface 对应同一运行时状态。
|
|
175
|
+
|
|
176
|
+
如果一个声明结果可能在代理表面通过、却在目标运行时独立失败,最早拥有可运行边界的 Outcome 必须声明项目自有的真实运行 Check,并在当前 Check 执行中启动或触达目标、从同一会话产生结构化 Observation。仓库内状态报告、截图、二进制、日志或历史运行不能单独证明目标运行时。Check 显式声明带 Key 的 Given/When 场景与 journey role;Assertion 声明 all-of Evidence Capability,并由类型化的当前执行记录证明。静态 `presence` 不能证明行为,降级路径不能替代要求的成功路径,固定输入不能证明输入变化,产生 side effect 的组件也不能自行证明其边界效果。当前 Goal 在第一个可运行切片后执行一次;后续相关修改先合并,在声明输入使 Progress stale 后、扩大依赖工作前再运行。它复用 targeted verify 与 Final Gate,不增加开放式 `platform_impact` 字段、逐平台 Progress 或替代 Gate,不要求每个 Outcome/每次编辑完整重建,也不提前取得接受权;Final Gate 仍会重跑。
|
|
171
177
|
|
|
172
|
-
|
|
178
|
+
只有 `weak_observability` 同时遇到多 Stage 或多个 required product runtime family 时,才额外要求一个只读 Global Product Conformance Check。它从 required root product target 启动,使用独立 Raw Execution,并在既有 Final Gate 内运行。单 Stage、单 family 继续使用原有 same-Check sensitivity,不支付额外 conformance 执行成本。
|
|
173
179
|
|
|
174
180
|
平台负责物理 Goal/会话生命周期。新会话通过 `resume` 恢复语义状态;Tiny Context 不会重建此前的物理 Turn。机器接受只覆盖 `declared_machine_authority`,并报告 `native_goal_effect: none`。完成平台原生 Goal 前,Agent 只做一次否决型核对:当前 Goal/用户语义是否全部进入 accepted marked Source,且没有 pending revision、未解 blocker 或遗漏;它只能阻止并触发修复,不能增加验收证据。
|
|
175
181
|
|
|
@@ -194,14 +200,14 @@ ty-context long-task abandon <workdir> [--force-corrupt-state]
|
|
|
194
200
|
```
|
|
195
201
|
|
|
196
202
|
- `init` 创建单文件 inline Outcome 的 Compact Contract 模板。
|
|
197
|
-
- `preflight` 应用 Compact 默认值并一次输出 Source/REQ/CTRL/OBL/AC、Context、风险、路径/Binding、Runner/Input 与 Proof 诊断;它完全只读,不创建 Authority Lock、marker、cache、progress、Receipt、pending revision、状态锁,也不运行项目 Check。
|
|
203
|
+
- `preflight` 应用 Compact 默认值并一次输出 Source/REQ/CTRL/OBL/AC、Stage closure、required-target/root/runner、scenario/journey、capability、external impact、Product Conformance、Context、风险、路径/Binding、Runner/Input 与 Proof 诊断;它完全只读,不创建 Authority Lock、marker、cache、progress、Receipt、pending revision、状态锁,也不运行项目 Check。
|
|
198
204
|
- `compile` 生成 Global 与 Outcome Result/Requirement/Control-field/Non-completing/Technical Claim,拒绝未覆盖 Claim,并让第一次正式成功 Compile 成为 Authority Lock。每次结果都包含 lifecycle event、`delivery_completed_by_this_event: false`、`native_goal_effect: none` 和 next action。第一次结果附带 `execution_model_checkpoint.required: true`,后续 Compile 返回 `false`;这些字段不进入 Authority state。
|
|
199
205
|
- `diagnose-revision` 只做无副作用候选 Compile;仅 scope-only 候选能运行 Active Authority 已有且未更换的 Check,输出固定为非验收、非 Progress、非 pending。
|
|
200
206
|
- `compile --revise` 自动采用可证明安全的修订;受保护修订在 stdout 返回 `authority_revision_pending`、精确 decision id 与确定性 material 摘要,并继续 fail closed,直到用户批准完全相同的 id。候选内容再变会生成新 id,并使旧批准失效。采用后输出 `authority_revision_adopted` 并回到滚动执行,不表示交付完成。
|
|
201
207
|
- `verify` 在重查 active task/revision/compiled/worktree identity 后写 scoped Progress;targeted verify 始终只是修复证据。
|
|
202
|
-
- `status` 输出 `unverified`、`progress_passing`、`progress_failing`、`progress_stale` 或 `blocked_external
|
|
203
|
-
- `resume` 完全只读,恢复 task/contract identity、风险、相关 Context、Git
|
|
204
|
-
- `final-gate` 在完整 Check 后再次验证 active identity;并发 revision 不能产生 accepted。
|
|
208
|
+
- `status` 输出 `unverified`、`progress_passing`、`progress_failing`、`progress_stale` 或 `blocked_external`,由当前 Progress 派生 `stages`、`ready_stages` 和受 Stage 约束的 Outcome frontier,不持久化 Stage 完成。它同时报告 fresh `final_workflow_status`、target profile/state、完整 `external_confirmations` 与唯一的 `pending_authority_revision`。`progress_passing` 只能表述为定向修复证据,不能简称“Outcome 完成”;`progress_stale` 不是当前通过,`final_workflow_status: null` 表示 Goal 尚未完成。
|
|
209
|
+
- `resume` 完全只读,恢复 task/contract identity、风险、相关 Context、Git 状态、相同的 Final/target/Stage/external/pending surface、ready Outcome、findings 和 next safe action。
|
|
210
|
+
- `final-gate` 在完整 Check 后再次验证 active identity;并发 revision 不能产生 accepted。Receipt 把每个 Stage 派生为 `passed`、`failed`、`blocked_external` 或 `blocked_dependency`,把 `target_state` 派生为 `not_accepted`、`blocked_external` 或 Contract 精确声明的 `implementation_complete`、`target_profile_usable`、`production_release_ready`。
|
|
205
211
|
- `stop-check` 与 `close` 自己运行 Live Final Gate,并只用 accepted identity 做 CAS clear。每次机器接受的 Stop 都给一个非阻塞 terminal-scope `systemMessage`;外部待确认时同时列出全部确认项。Final/Stop/close 输出 `acceptance_scope: declared_machine_authority` 与 `native_goal_effect: none`,close 另输出 `closed_scope: machine_authority`。`status: closed` 只表示机器 Authority 已清理,不表示原生 Goal 或完整外部交付完成。
|
|
206
212
|
- `abandon --force-corrupt-state` 仅用于损坏/mismatch/legacy-unrecoverable 状态或遗留锁,只删除确定性 active state 与 `<workdir>/.ty-context/**`。
|
|
207
213
|
|
|
@@ -211,12 +217,13 @@ ty-context long-task abandon <workdir> [--force-corrupt-state]
|
|
|
211
217
|
|
|
212
218
|
Contract 顶层包含:
|
|
213
219
|
|
|
214
|
-
- `task`:完整目标、Source 路径、相关 Context 与 snapshot 模式;
|
|
220
|
+
- `task`:完整目标、target profile、required target refs、execution target/runtime family/root entrypoint、Source 路径、相关 Context 与 snapshot 模式;
|
|
221
|
+
- `stages`:有序 Stage DAG 与每个 Stage 的 gate Outcome;
|
|
215
222
|
- `risk`:`auto | standard | strict` 与明确 risk facts;
|
|
216
223
|
- `global`:非目标、owner boundary、技术约束、禁止路径/捷径和全局 Check;
|
|
217
|
-
- `outcomes
|
|
224
|
+
- `outcomes`:可独立判断并可定向验证的纵向结果、所属 Stage、依赖、明确 success/degradation 要求、REQ、产品/控件状态与位置、稳定技术义务和命名 AC。
|
|
218
225
|
|
|
219
|
-
Runner 支持 `package_script`、`project_binary`、`node_oracle`、`playwright_test`。Proof surface 支持 `ui_browser`、`runtime_behavior`、`api_contract`、`data_state`、`security_boundary`、`population_coverage`、`implementation_structure`。
|
|
226
|
+
Runner 支持 `package_script`、`project_binary`、`node_oracle`、`playwright_test`。Proof surface 支持 `ui_browser`、`runtime_behavior`、`api_contract`、`data_state`、`security_boundary`、`population_coverage`、`implementation_structure`。Execution target family 是有界的 `browser`、`native`、`desktop`、`service`、`process`、`external`,role 是 `product`、`support`、`observer`;required ref 只能指向 product target。Browser target 只能由 `playwright_test` 证明,Native/desktop target 只能由 `project_binary` 证明。
|
|
220
227
|
|
|
221
228
|
### 一个 Contract 与 Source Claim
|
|
222
229
|
|
|
@@ -238,12 +245,18 @@ V2 强制至少一个真实 `source_path` 与一个 `source_claim`,且每个
|
|
|
238
245
|
|
|
239
246
|
## Evidence 与完成权威
|
|
240
247
|
|
|
241
|
-
最终接受来自当前可执行证据,不来自 Agent 文本。Evidence Adapter 由 Runner 派生:只有 `playwright_test → playwright_json_v1` 可以证明 `ui_browser`,其余 Runner
|
|
248
|
+
最终接受来自当前可执行证据,不来自 Agent 文本。Evidence Adapter 由 Runner 派生:只有 `playwright_test → playwright_json_v1` 可以证明 `ui_browser`,其余 Runner 使用 `structured_json_v2` Adapter 证明非浏览器 Surface,并在需要 capability record 时输出增量 `long-task-check-result-v3` payload。V2 payload 只保留解码兼容,不能满足非 `presence` 能力。
|
|
249
|
+
|
|
250
|
+
每个 Check 声明非空、带 Key 的 `scenario.given`/`scenario.when`,并使用 `success`、`degradation`、`recovery`、`stage_gate`、`conformance` journey role。每个 Assertion 声明 `presence`、`interaction_trace`、`state_delta`、`cross_surface_consistency`、`durable_readback`、`boundary_invocation`、`external_side_effect`、`failure_injection`、`visual_render`、`target_runtime`、`input_variation` 中所需的 all-of 集合。除了静态 `presence`,每种能力恰好需要一条绑定该 Assertion 的当前执行记录;缺失、重复、未知或未声明记录全部 fail closed。Result 只能由 success Check 证明;success 与 degradation 不能共用一个 Check;外部边界从 observer target 观察;input variation 至少证明两个不同输入、两个输出 hash 和一个失败样例。
|
|
242
251
|
|
|
243
252
|
每个 Outcome 至少有一个非 Result 原子 Claim,且 `required_proof_surfaces` 必须 all-of 全覆盖。Claim-bearing Assertion 使用显式 Expected 比较;`truthy/falsy` 禁止,`exists` 仅允许证明 `implementation_structure` Obligation。
|
|
244
253
|
|
|
245
254
|
Targeted verify、Progress、status、Receipt 与 compiled cache 都不是完成权威。Final Gate 要求 clean candidate commit,从 Source 重新 Compile,在同一 Git-tree snapshot 上运行全部 Global/Outcome Check,并在结束时再次校验 active identity。只有它可以生成 `machine_accepted` 或 `machine_accepted_external_pending`;后者仍必须明确列出外部确认项。
|
|
246
255
|
|
|
256
|
+
## 兼容与迁移
|
|
257
|
+
|
|
258
|
+
0.7.2 在同一个 `long-task-delivery-v2` 权威中增加 ordered Stage、required target/root entrypoint、显式 success/degradation journey 与 scenario、类型化 Evidence Capability、类型化 external impact、按风险触发的 Product Conformance,以及 terminal target/Stage projection。缺少这些字段的旧 V2 Contract 会报告可索引的人工迁移 `long-task-v2-semantic-drift-authority`;必须依据 Source 重新表达缺失语义。Upgrade 不会猜测这些含义,也不会把旧 Progress/Receipt 当作通过证据。
|
|
259
|
+
|
|
247
260
|
## 开发与验证
|
|
248
261
|
|
|
249
262
|
```powershell
|
|
@@ -10,7 +10,7 @@ Unless an active Long-Task binding exists:
|
|
|
10
10
|
|
|
11
11
|
1. Read `project_context/global.md`, `project_context/architecture.md`, `project_context/context.toml` and the default area root, then collect graph/trigger candidates.
|
|
12
12
|
2. Before deciding `Context Delta`, run one bounded text search over `project_context/**` using a small set of high-signal task terms such as explicit area/module names and API/schema/state/security/verification/deployment terms. Merge matching Context with manifest candidates and read only relevant files; search supplements rather than replaces semantic judgment.
|
|
13
|
-
3. For UI/product-surface work, confirm information/action/feedback ownership and use `context_surface_contract` when durable responsibility is unclear or changes; contract owns interfaces and existing area/subdomain/verification roles own the project facts.
|
|
13
|
+
3. For UI/product-surface work, confirm information/action/feedback ownership and use `context_surface_contract` when durable responsibility is unclear or changes; the contract owns interfaces and existing area/subdomain/verification roles own the project facts. Before material production UI implementation, also read `DESIGN.md`, its token source and referenced design targets: an unconfigured starter, style-only guidance or inspiration does not authorize invented production layout; use a declared exact/constraint target, route explicit design work through `context_uiux_design`, or stop for a genuine design decision. Local style fixes and explicit prototypes remain lightweight.
|
|
14
14
|
4. Decide exactly one `Context Delta: none|required`. Update owning Context before code when durable product ownership, architecture, API/schema/data, state/recovery, dependency, security, product-surface responsibility or repeatable verification/deployment changes. Local fixes preserving durable semantics are `none`.
|
|
15
15
|
5. Use the agent/platform internal plan. For high-risk work keep `Architecture Context Hit`, `Decision Rationale Hit: existing|required|none` and `Modularity Check: none|required|exception` as internal routing and maintenance questions, not artifacts or extra deltas.
|
|
16
16
|
6. Implement precisely, run project-owned verification, perform Contract Conformance and a Context drift check, then report implementation, verification, Context status and blockers.
|
|
@@ -29,20 +29,20 @@ Do not infer long-task mode from duration, complexity, file count or agent prefe
|
|
|
29
29
|
|
|
30
30
|
Contract Draft authoring belongs inside `long-task-workflow`: continuously revise the same non-authoritative `delivery-contract.yaml` until the first successful formal Compile creates Authority Lock. An optional Source Plan is ordinary upstream Source guidance, not a Contract Draft or required input protocol.
|
|
31
31
|
|
|
32
|
-
The workflow uses one native Goal, one selected workspace, one Contract and one Final Gate. New authoring uses inline Outcomes; existing `outcome_files` are physical compatibility only.
|
|
32
|
+
The workflow uses one native Goal, one selected workspace, one Contract and one Final Gate. New authoring uses inline vertical Outcomes grouped by ordered Stages; existing `outcome_files` are physical compatibility only. Target profiles name required product targets and root runtimes; Checks declare Given/When journeys and all-of Evidence Capabilities. Stage/frontier state is derived from ordinary Progress and creates no second Gate, Receipt, scheduler or completion authority.
|
|
33
33
|
|
|
34
34
|
After the first Authority Lock, stop once before implementation and ask the user to continue with the current model or switch models and then resume the active Long-Task. A model choice already stated explicitly for this task satisfies the checkpoint; later revisions do not repeat it. Harness records no model route or checkpoint state.
|
|
35
35
|
|
|
36
36
|
Before authoring, proof design or authority lifecycle work, read the phase-specific references in the package-managed `long-task-workflow` Skill. Use `ty-context long-task help` for CLI syntax instead of treating this startup router as a command reference.
|
|
37
37
|
|
|
38
|
-
Final Gate, Stop and close recompile the source Contract and rerun every declared Check on one clean current snapshot. Targeted verify is repair evidence only. Status, progress, receipts and compiled cache are audit/recovery surfaces only; prose, historical tests or Agent judgment never create acceptance. An adopted Authority Revision returns to rolling execution and is never delivery completion. External confirmations remain explicit; machine acceptance
|
|
38
|
+
Final Gate, Stop and close recompile the source Contract and rerun every declared Check on one clean current snapshot. Required targets cannot substitute for one another; presence cannot prove behavior; success and degradation remain distinct; typed boundary effects require an observer. Targeted verify is repair evidence only. Status, progress, Stage/frontier projections, receipts and compiled cache are audit/recovery surfaces only; prose, historical tests or Agent judgment never create acceptance. An adopted Authority Revision returns to rolling execution and is never delivery completion. External confirmations remain typed and explicit; machine acceptance reports target/stage qualification but cannot by itself authorize completing the platform-native Goal, CI, deployment or human acceptance.
|
|
39
39
|
|
|
40
40
|
Tiny Context does not create or restore platform Goals, invoke models, spawn agents, call an App Server, create branches/worktrees, merge, push, open PRs, deploy or manage process trees. `ty-context enable long-task` installs the Source Plan Authoring Skill, Long-Task Workflow Skill and package-owned completion Hook.
|
|
41
41
|
|
|
42
42
|
## Durable Facts And Generated Surfaces
|
|
43
43
|
|
|
44
44
|
- Context is intended ownership/boundary/contract truth; code is current implementation truth. Treat disagreement as drift, missing work or stale Context.
|
|
45
|
-
- Long-term facts live only in `project_context/**` or `DESIGN.md`; logs, raw evidence, secrets, runtime state and receipts do not.
|
|
45
|
+
- Long-term facts live only in `project_context/**` or `DESIGN.md`; versioned authored design targets may remain referenced project Source/verifier inputs, while generated screenshots/diffs, logs, raw evidence, secrets, runtime state and receipts do not become Context.
|
|
46
46
|
- Managed `AGENTS.md` blocks, `<harnessRoot>/ty-context-managed/**` and package-managed Skills are generated and sync-overwritten.
|
|
47
47
|
- Explicit upgrades use `context_harness_upgrade`; package sync never imports retired Campaign or development-period authority state.
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ Tiny Context does not create or restore platform Goals, invoke models, spawn age
|
|
|
50
50
|
|
|
51
51
|
- `make validate-context`: Context recoverability.
|
|
52
52
|
- `make validate-harness`: Context plus touched-source modularity.
|
|
53
|
-
- `ty-context doctor`: installation health plus advisory default Context footprint.
|
|
53
|
+
- `ty-context doctor`: installation health plus advisory default Context footprint and Design Authority status.
|
|
54
54
|
- `node packages/ty-context/dist/cli.js package check-source`: managed-source/package parity in this source workspace.
|
|
55
55
|
|
|
56
56
|
Every handoff reports exactly one of `Context: updated ...` or `Context: no durable fact change`. Never claim tests, deployment or acceptance from Context alone.
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
- Capture durable screen, flow, interaction, responsive and accessibility facts. Use `DESIGN.md` for visual identity and design tokens when needed.
|
|
37
37
|
- For web/front-end surfaces, record durable page responsibilities, core user judgments, persistent information boundaries and cross-page or cross-layer ownership when they guide future changes.
|
|
38
|
+
- Reference durable versioned design targets at their project-native path or URI and classify them as `exact-target`, `constraint` or `inspiration`; do not paste generated implementation screenshots, diffs or review logs into Context.
|
|
38
39
|
|
|
39
40
|
## Verification Entry Points
|
|
40
41
|
|
|
@@ -72,13 +72,16 @@ sample provider / interface / page 证据不能替代 all-provider / all-interfa
|
|
|
72
72
|
|
|
73
73
|
## Visual Delivery Implementation / 视觉交付实现
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
For material production UI, first confirm Design Authority readiness; then carry declared Context, `DESIGN.md` and Source intent into the real implementation without creating another workflow:
|
|
76
76
|
|
|
77
|
+
- treat an unconfigured starter, style-only guidance, inspiration-only references or conflicting targets as insufficient authority for invented production layout; route explicit design authoring through `context_uiux_design` or return for a genuine material decision;
|
|
78
|
+
- classify referenced targets as `exact-target`, `constraint` or `inspiration` and bind fidelity claims only to the named target/constraint conditions;
|
|
77
79
|
- identify the production token source, its generation direction, the owning components/routes and any project-local UI/UX Skill before choosing implementation values;
|
|
78
80
|
- reuse production components and real product routes for states/specimens instead of building a detached static imitation as the acceptance target;
|
|
79
81
|
- preserve approved semantic tokens and component APIs; do not bypass them with undeclared raw color, spacing, typography or motion values merely to match one screenshot;
|
|
80
82
|
- implement the declared Visual Coverage Set across the applicable viewport, theme/mode, state, content-stress and accessibility/motion combinations, while avoiding an unrequested full Cartesian expansion;
|
|
81
83
|
- run project-owned rendered/component/browser verification and report only the combinations actually checked. Static analysis, generated kits and screenshot artifacts are supporting review material rather than proof of every visual or behavioral claim.
|
|
84
|
+
- never promote the implementation's own generated screenshot/diff into its target; exact targets and acceptance-affecting baselines are selected Source/verifier inputs before comparison.
|
|
82
85
|
|
|
83
86
|
If an active Long-Task applies, express material visual expectations through its existing Requirement, Control, Assertion, Check and external-confirmation mechanisms. Do not introduce a second visual plan, acceptance document or lifecycle.
|
|
84
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: context_uiux_design
|
|
3
|
-
description: Use when the user explicitly asks for 设计稿, 重做设计, UI/UX 设计方案, UI 设计师, UX 设计师, 视觉设计方案, 视觉专家, 交互设计方案, 界面设计方案, 页面设计方案, 原型设计, 线框图方案, 视觉规范, 设计系统方案, DESIGN.md, Impeccable review, UX designer, UI designer, frontend redesign, visual polish, or design system spec in a Minimal Context Harness project. Do not trigger for
|
|
3
|
+
description: Use when the user explicitly asks for 设计稿, 重做设计, UI/UX 设计方案, UI 设计师, UX 设计师, 视觉设计方案, 视觉专家, 交互设计方案, 界面设计方案, 页面设计方案, 原型设计, 线框图方案, 视觉规范, 设计系统方案, DESIGN.md, Impeccable review, UX designer, UI designer, frontend redesign, visual polish, or design system spec, or when material production UI lacks sufficient or consistent Design Authority in a Minimal Context Harness project. Do not trigger for routine implementation that already has sufficient design authority, local CSS tweaks, UI bug fixes, explicit throwaway prototypes, or generic mentions of 设计, design, or user experience.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Context UIUX Design
|
|
@@ -18,13 +18,13 @@ Project-specific UI/UX and visual design rules belong in a separate project-loca
|
|
|
18
18
|
## 工作方式
|
|
19
19
|
|
|
20
20
|
1. 先读取 `project_context/global.md` 和 `project_context/context.toml`,按 default area、triggers、read_when 选择相关 context。
|
|
21
|
-
2. 如果项目存在 `DESIGN.md
|
|
22
|
-
3. 整理或生成:用户流程、页面/组件清单、关键状态、交互反馈、响应式边界、a11y
|
|
21
|
+
2. 如果项目存在 `DESIGN.md`,先读取其 Design Authority 状态、唯一 token 源/生成方向和设计引用;如果用户要求视觉体系、设计稿或界面风格,按 Google `@google/design.md` 的 DESIGN.md 格式创建或更新根目录 `DESIGN.md`。
|
|
22
|
+
3. 整理或生成:用户流程、页面/组件清单、关键状态、交互反馈、响应式边界、a11y 要求、视觉约束、设计 token,以及需要长期复用的 design reference registry。
|
|
23
23
|
4. 涉及 Product Surface(Web 页面、移动/桌面屏幕、游戏 UI/HUD/菜单、CLI/TUI 输出、扩展或设备界面)、前端布局、UI/UX、产品模块边界或信息放置时,把产品/页面定位检查作为前置动作:用户在这个 surface 要完成的判断、产品必须提供的信息/动作/反馈、不应常驻的信息、主层/下钻/运维/诊断/详情归属、布局和信息密度是否匹配任务。多 surface、多平台或多模块归属不清时,先读取相关 Context、搜索入口并结合已有 UI 代码/截图做信息架构 sweep,必要时使用 `context_surface_contract` 做 Surface Contract Check,再收窄到具体视觉或交互实现。该检查是下一步变更分类的输入;只有形成长期 surface 职责、信息架构、交互契约或模块边界结论时才更新 Context 或 `DESIGN.md`。
|
|
24
24
|
- 若存在 Product Surface Contract,读取并对齐 primary user question、main allows/forbids、drilldown ownership、long-task state 和 verification。
|
|
25
25
|
- 若缺失且本任务改变 durable surface responsibility,输出 `Surface Contract Delta: required`,把界面职责写入 `project_context/**`;视觉 token、颜色、字体、间距、圆角和视觉 rationale 仍写入 `DESIGN.md`。
|
|
26
26
|
5. 涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或加载/空态/错误态等 UI 控件时,用“控件交互框架”检查控件语义、反馈状态、校验、错误预防、可供性和信息密度;这只是通用判断框架,不是固定控件处方。
|
|
27
|
-
6. 界面职责、流程归属和长期交互契约以 `project_context/**` 为准;`DESIGN.md` 负责视觉 token
|
|
27
|
+
6. 界面职责、流程归属和长期交互契约以 `project_context/**` 为准;`DESIGN.md` 负责视觉 token、视觉 rationale、唯一 authored token source/generation direction 和设计引用解释;versioned authored targets 保留在项目原生路径,代码与生成截图只说明当前实现状态。Context 决定“应该是什么”,代码和实现截图揭示“现在是什么”,代码不能静默重定义 Context。
|
|
28
28
|
7. 设计判断或第一处实现编辑前,先给出唯一长期事实判断 `Context Delta: none|required`。若输入包含产品、架构、技术、界面或验收来源,在 agent 内部逐项判断 durable surface / IA / interaction / verification constraint 已被 Context / `DESIGN.md` 覆盖、需要先更新、仅属 task-local、显式 out-of-scope 或需要真实用户决策;不要创建 `plan.md`、Task Contract 文件或 Markdown 映射表。
|
|
29
29
|
8. 普通 UI bug、局部样式或 CSS 修复、测试修复或探索性 spike 不更新 Context,可先改代码;一旦形成长期交互或视觉结论,继续对齐或交付前必须回写 Context 或 `DESIGN.md`。不要把 Context 机械补成代码改动摘要。
|
|
30
30
|
9. 如果二者冲突,显式标记为实现漂移、缺失工作或 Context 过期。
|
|
@@ -82,6 +82,17 @@ Project-specific UI/UX and visual design rules belong in a separate project-loca
|
|
|
82
82
|
- 视觉审查时先分清问题类型:a11y / responsive / theming / interaction / copy / performance / anti-pattern。把真正影响用户理解、操作或品牌信任的问题列为高优先级;少量纯审美偏好不要淹没关键问题。
|
|
83
83
|
- Harness 默认携带 Impeccable CLI 能力;做设计稿、重做设计、视觉设计方案、设计系统方案、frontend redesign、visual polish 或既有 UI 视觉审查时,默认尝试运行 `npx impeccable detect <target>` 作为辅助证据,不必等待用户点名。其输出只能作为设计缺陷线索,不是 Harness gate,也不能替代人工截图检查、项目测试或 `validate-context`。
|
|
84
84
|
|
|
85
|
+
## Design Authority Readiness / 设计权威就绪
|
|
86
|
+
|
|
87
|
+
Use this check before material production UI: a new or redesigned screen, primary layout/navigation/theme/component system, high-fidelity implementation or substantial visual polish. Routine implementation with sufficient authority, local style fixes and explicit throwaway prototypes stay on the lightweight path.
|
|
88
|
+
|
|
89
|
+
- Read the owning surface/interaction Context, `DESIGN.md`, the authored exact-value token source and generation direction, existing production components/routes and every material design reference.
|
|
90
|
+
- Classify each reference as `exact-target`, `constraint` or `inspiration`. Record the affected surface/route/component, project path or URI and relevant viewport/theme/mode/state. Exact targets authorize fidelity comparison only for those conditions; constraints authorize only their named rule; inspiration proves no reproduction claim.
|
|
91
|
+
- Treat a missing `DESIGN.md`, its package starter with Design authority status: `unconfigured`, style-only prose, an inspiration-only set or conflicting references as insufficient authority for invented production layout.
|
|
92
|
+
- If the user explicitly delegates design, use known product goals, preferences and references to author/select a separate target before implementation and update durable Context/`DESIGN.md` when the choice is stable. Ask only when an unknown material preference could change the result or the user reserves the choice.
|
|
93
|
+
- Never use the implementation's own generated screenshot or diff as the target it claims to match. A target is selected Source; an implementation render is evidence. Baseline replacement requires deliberate review and cannot merely erase a failure.
|
|
94
|
+
- Do not require Figma, a fixed `docs/design/**` tree, an image for every local change or universal pixel-perfect thresholds. Use project-native design assets and the smallest authority sufficient for the claimed fidelity.
|
|
95
|
+
|
|
85
96
|
## Visual Delivery Coverage / 视觉交付覆盖
|
|
86
97
|
|
|
87
98
|
For material design-system, redesign, high-fidelity implementation or visual-polish work, keep a task-local **Visual Coverage Set** before implementation and verification. It is internal planning, not a required file, matrix, Context role, workflow artifact or completion authority.
|
|
@@ -89,6 +100,7 @@ For material design-system, redesign, high-fidelity implementation or visual-pol
|
|
|
89
100
|
- Select risk-proportional representative combinations across production surface/route/component, viewport, theme or product mode, interaction/state, content stress and accessibility/motion conditions. Do not expand the full Cartesian product unless Source explicitly requires full combination coverage, and never claim an unchecked combination.
|
|
90
101
|
- Cover relevant states such as default, hover, focus, active, disabled, loading, empty/no-results, error, success and long/extreme content. Use the project's declared viewport, contrast, target-size, reduced-motion and localization rules rather than inventing universal thresholds.
|
|
91
102
|
- Keep the authority split explicit: `project_context/**` owns durable surface/interaction responsibility and `DESIGN.md` owns durable visual-system semantics and rationale. Record one authored exact-value token source and one generation direction; generated CSS/theme/export files are implementation outputs, not competing authored truth. If `DESIGN.md` is not the machine-token source, name the project-native source it governs instead of hand-maintaining the same exact values twice.
|
|
103
|
+
- Map every claimed fidelity combination to its selected `exact-target` or named `constraint`; do not let the Visual Coverage Set turn inspiration or missing authority into an implicit target.
|
|
92
104
|
- Inspect production components or real product routes. A detached static kit, mock, poster, marketing specimen or generated showcase may guide design review, but it cannot be the only evidence for product UI behavior or fidelity.
|
|
93
105
|
- Render and inspect the declared coverage with project-owned browser/component tests plus screenshots or manual review as appropriate. Report the combinations actually checked and any omitted or external review explicitly. A screenshot baseline may be updated only through deliberate review; replacing it merely to erase a diff is not verification.
|
|
94
106
|
|
|
@@ -98,12 +110,13 @@ For material design-system, redesign, high-fidelity implementation or visual-pol
|
|
|
98
110
|
- 不要求 lifecycle phase、plan task、phase gate 或阶段 Skill。
|
|
99
111
|
- 如果用户明确要求独立设计稿、mock 或页面说明,可以临时生成;长期事实仍要提炼回 `project_context/**` 和 `DESIGN.md`。
|
|
100
112
|
- `DESIGN.md` 是视觉设计系统事实源;项目流程、模块契约和下一步动作仍以 `project_context/**` 为准。
|
|
101
|
-
-
|
|
113
|
+
- 如果普通页面实现已经有充分 Design Authority,或用户只要求修复 UI bug、局部改 CSS、换颜色、明确的 throwaway prototype,或只是泛泛提到“设计 / design / user experience”,不需要触发本 Skill;明确角色/产物、视觉体系工作,或 material production UI 缺失/冲突的 Design Authority 才使用。
|
|
102
114
|
|
|
103
115
|
## DESIGN.md 使用规则
|
|
104
116
|
|
|
105
117
|
- 使用 Google `@google/design.md` 格式:YAML front matter 存 tokens,Markdown body 存设计理由。
|
|
106
118
|
- 优先包含 `name`、`colors`、`typography`、`spacing`、`rounded` 和必要 `components` token。
|
|
119
|
+
- 在 `Overview` 内维护 Design Authority 状态、唯一 authored token source/generation direction 和 design reference registry;每个 durable reference 记录稳定 id、surface/route/component、path/URI、`exact-target` / `constraint` / `inspiration` 解释及覆盖条件。不要添加 Google schema 不支持的 front-matter keys。
|
|
107
120
|
- Markdown section 顺序优先为:`Overview`、`Colors`、`Typography`、`Layout`、`Elevation & Depth`、`Shapes`、`Components`、`Do's and Don'ts`。
|
|
108
121
|
- 写入或修改后,如本地可用,运行 `npx @google/design.md lint DESIGN.md` 检查结构;不要把 lint 结果写成“已通过”除非本轮真实执行。
|
|
109
122
|
- 需要给工程消费 token 时,可用 `npx @google/design.md export --format css-tailwind DESIGN.md` 或 `json-tailwind` 生成临时输出。
|
|
@@ -118,6 +131,6 @@ For material design-system, redesign, high-fidelity implementation or visual-pol
|
|
|
118
131
|
- `areas/*/verification.md` 或 role=`verification` Context:UI smoke、截图验收、可访问性检查或项目自己的关键验证重复执行路径。
|
|
119
132
|
- `areas/*/deployment.md` 或 role=`deployment` Context:前端部署、预览环境、运行拓扑或健康检查重复执行路径。
|
|
120
133
|
- `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。
|
|
121
|
-
- `DESIGN.md`:视觉 identity、design tokens、组件视觉规则、do/don't
|
|
134
|
+
- `DESIGN.md`:视觉 identity、design tokens、组件视觉规则、do/don't、视觉 rationale、唯一 token source/generation direction 和 design reference registry。
|
|
122
135
|
|
|
123
136
|
不要编造 rationale;仅由当前代码或截图形态反推的理由、实现摘要、PR notes、命令输出、测试通过声明、截图审查、debug 过程和 agent reasoning 不进入 Context 或 `DESIGN.md`。
|