project-tiny-context-harness 0.7.0 → 0.7.1
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/LICENSE +21 -21
- package/README.md +317 -315
- package/assets/README.md +471 -469
- package/assets/README.zh-CN.md +240 -238
- package/assets/agents/.gitkeep +1 -1
- package/assets/agents/AGENTS_CORE.md +56 -56
- package/assets/context_templates/architecture.md +33 -33
- package/assets/context_templates/area.md +39 -39
- package/assets/context_templates/context.toml +30 -30
- package/assets/context_templates/deployment.md +35 -35
- package/assets/context_templates/global.md +55 -55
- package/assets/context_templates/product-surface-contract.md +63 -63
- package/assets/context_templates/verification.md +32 -32
- package/assets/github/.gitkeep +1 -1
- package/assets/github/harness.yml +41 -41
- package/assets/make/.gitkeep +1 -1
- package/assets/make/ty-context.mk +48 -48
- package/assets/skills/context_development_engineer/SKILL.md +90 -90
- package/assets/skills/context_full_project_export/SKILL.md +70 -70
- package/assets/skills/context_harness_upgrade/SKILL.md +60 -60
- package/assets/skills/context_product_plan/SKILL.md +77 -77
- package/assets/skills/context_surface_contract/SKILL.md +171 -171
- package/assets/skills/context_uiux_design/SKILL.md +99 -99
- package/assets/skills/long-task-workflow/SKILL.md +72 -70
- package/assets/skills/long-task-workflow/agents/openai.yaml +4 -4
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +44 -40
- package/assets/skills/long-task-workflow/references/contract-authoring.md +57 -43
- package/assets/skills/long-task-workflow/references/evidence-design.md +40 -32
- package/assets/skills/normal-long-task/SKILL.md +12 -12
- package/assets/skills/source-plan-authoring/SKILL.md +295 -295
- package/migrations/README.md +8 -8
- package/package.json +1 -1
- package/source-mappings.yaml +25 -25
package/assets/README.md
CHANGED
|
@@ -1,447 +1,449 @@
|
|
|
1
|
-
# Project Tiny Context Harness
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/project-tiny-context-harness)
|
|
4
|
-
[](https://github.com/Seven128/project-tiny-context-harness/actions/workflows/package.yml)
|
|
5
|
-
[](https://securityscorecards.dev/viewer/?uri=github.com/Seven128/project-tiny-context-harness)
|
|
6
|
-
[](LICENSE)
|
|
7
|
-
[](https://codespaces.new/Seven128/project-tiny-context-harness)
|
|
8
|
-
|
|
9
|
-
Translations: [Chinese (Simplified)](README.zh-CN.md)
|
|
10
|
-
|
|
11
|
-
Project Tiny Context Harness is repo-native project memory for AI coding agents, plus a narrow delivery harness for trustworthy long-task completion. The product principle is: keep the memory, drop the ceremony. It adds durable project memory behind `AGENTS.md` without becoming an agent scheduler or Git orchestrator.
|
|
12
|
-
|
|
13
|
-
Public launch surfaces are English-first; localized documents are secondary entry points.
|
|
14
|
-
|
|
15
|
-
Best for:
|
|
16
|
-
|
|
17
|
-
- repositories where coding agents repeatedly rediscover project intent;
|
|
18
|
-
- teams using multiple agents or frequent fresh chats;
|
|
19
|
-
- maintainers who want durable Context and explicit long-task evidence.
|
|
20
|
-
|
|
21
|
-
Not for:
|
|
22
|
-
|
|
23
|
-
- replacing project tests, review, CI or human acceptance;
|
|
24
|
-
- autonomous Tiny Context execution;
|
|
25
|
-
- codebase semantic indexing or external docs retrieval.
|
|
26
|
-
|
|
27
|
-
Concrete shift:
|
|
28
|
-
|
|
29
|
-
```text
|
|
30
|
-
Before: ask a fresh agent to read the repo and tell you what matters.
|
|
31
|
-
After: ask it to read AGENTS.md and project_context/** first, then summarize goal, non-goals, architecture boundaries and validation paths before proposing code.
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
What gets added:
|
|
35
|
-
|
|
36
|
-
```mermaid
|
|
37
|
-
flowchart LR
|
|
38
|
-
A["Fresh agent session"] --> B["AGENTS.md startup router"]
|
|
39
|
-
B --> C["project_context/** durable facts"]
|
|
40
|
-
C --> D["Goal, boundaries, validation paths"]
|
|
41
|
-
D --> E["Implementation and delivery work"]
|
|
42
|
-
F["Tests / CI / review"] --> G["Product quality evidence"]
|
|
43
|
-
C -. "does not own" .-> G
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-

|
|
47
|
-
|
|
48
|
-
The demo shows the core loop: initialize `AGENTS.md` and `project_context/**`, run `validate-context`, then ask a fresh agent to recover intent before proposing code. Use the npm install path below, or inspect the no-install previews first.
|
|
49
|
-
|
|
50
|
-
Install:
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
npm install -D project-tiny-context-harness@latest
|
|
54
|
-
npx --yes --package project-tiny-context-harness@latest ty-context init
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
No-install preview:
|
|
58
|
-
|
|
59
|
-
- Read the [fresh-agent recovery walkthrough](docs/examples/fresh-agent-recovery.md).
|
|
60
|
-
- Inspect the [Minimal Context sample guide](docs/examples/minimal-context-sample.md).
|
|
61
|
-
- Browse the tiny generated repository at [examples/minimal-context-sample/](examples/minimal-context-sample/).
|
|
62
|
-
|
|
63
|
-
## Why It Exists
|
|
64
|
-
|
|
65
|
-
Coding agents need two different kinds of help:
|
|
66
|
-
|
|
67
|
-
- durable facts that survive sessions without loading the whole repository;
|
|
68
|
-
- trustworthy completion checks when a task spans many edits or context compactions.
|
|
69
|
-
|
|
70
|
-
Tiny Context keeps those concerns narrow. `project_context/**` records durable ownership, architecture, contracts and repeatable verification. The default Workflow Contract combines manifest routing with one bounded Context search before `Context Delta`. The explicit Long-Task Workflow adds one machine-checked Delivery Contract, a one-time post-Authority-Lock model choice, rolling repair verification, a same-snapshot Final Gate and Stop freshness.
|
|
71
|
-
|
|
72
|
-
It does not launch or switch models, spawn agents, create branches or worktrees, merge, push, open pull requests, deploy, or claim to replace project tests and human acceptance.
|
|
73
|
-
|
|
74
|
-
## Capability Model
|
|
75
|
-
|
|
76
|
-
1. **Minimal Context** — small, role-aware durable facts under `project_context/**`.
|
|
77
|
-
2. **Workflow Contract** — Context-first default engineering behavior using the platform's internal plan; no required plan artifact.
|
|
78
|
-
3. **Long-Task Workflow** — explicit Single-Goal Rolling Delivery with `long-task-delivery-v2`, compiled Claim Coverage and a verifier-owned Live Final Gate.
|
|
79
|
-
|
|
80
|
-
The opt-in long-task profile also provides `/source-plan-authoring`, an upstream Source-quality helper rather than another authority layer.
|
|
81
|
-
|
|
82
|
-
Default profiles are `core-portable` and `workflow-default`. Enable the opt-in profile with:
|
|
83
|
-
|
|
84
|
-
```powershell
|
|
85
|
-
ty-context enable long-task
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
This installs `/source-plan-authoring`, `/long-task-workflow` and the completion Hook. It does not install an agent runtime, model worker, scheduler, or Git orchestration assets.
|
|
89
|
-
|
|
90
|
-
## Try It In 60 Seconds
|
|
91
|
-
|
|
92
|
-
```sh
|
|
93
|
-
mkdir project-tiny-context-harness-demo
|
|
94
|
-
cd project-tiny-context-harness-demo
|
|
95
|
-
git init
|
|
96
|
-
npm init -y
|
|
97
|
-
npm install -D project-tiny-context-harness@latest
|
|
98
|
-
npx --yes --package project-tiny-context-harness@latest ty-context init
|
|
99
|
-
make validate-context
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Then open `AGENTS.md`, `project_context/global.md` and `project_context/architecture.md`.
|
|
103
|
-
|
|
104
|
-
Expected result:
|
|
105
|
-
|
|
106
|
-
```text
|
|
107
|
-
AGENTS.md
|
|
108
|
-
project_context/
|
|
109
|
-
context.toml
|
|
110
|
-
global.md
|
|
111
|
-
architecture.md
|
|
112
|
-
areas/main.md
|
|
113
|
-
areas/main/verification.md
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Fresh-agent test prompt:
|
|
117
|
-
|
|
118
|
-
```text
|
|
119
|
-
Read AGENTS.md and project_context/** first. Summarize the project goal, non-goals, architecture boundaries, validation entry points and next safe action before proposing code changes.
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
For an existing repository, use `npx --yes --package project-tiny-context-harness@latest ty-context init --adopt`.
|
|
123
|
-
|
|
124
|
-
### Source checkout preview:
|
|
125
|
-
|
|
126
|
-
Open <https://codespaces.new/Seven128/project-tiny-context-harness>, or run locally:
|
|
127
|
-
|
|
128
|
-
```sh
|
|
129
|
-
git clone https://github.com/Seven128/project-tiny-context-harness.git
|
|
130
|
-
cd project-tiny-context-harness
|
|
131
|
-
npm ci
|
|
132
|
-
npm run smoke:quickstart
|
|
133
|
-
npm run preview:pack
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
The smoke packs the local workspace, installs it into a disposable repo and validates the generated Minimal Context files. Use this path for package development, source-preview testing or private review.
|
|
137
|
-
|
|
138
|
-
```sh
|
|
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.
|
|
141
|
-
npx --no-install ty-context init --adopt
|
|
142
|
-
make validate-context
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
If it fails, open a [Source preview report](https://github.com/Seven128/project-tiny-context-harness/issues/new?template=source_preview_report.yml).
|
|
146
|
-
|
|
147
|
-
## Positioning
|
|
148
|
-
|
|
149
|
-
| Adjacent tool type | Use it for | Harness stance |
|
|
150
|
-
|---|---|---|
|
|
151
|
-
| Spec-first kits | Turning a feature idea into structured specs and plans. | Complementary; Harness keeps durable repo facts beyond one feature spec. |
|
|
152
|
-
| BMAD-style workflows and full Tiny Context processes | Role/process ceremony for selected work. | Lighter default; ordinary work stays Context-first. |
|
|
153
|
-
| Task Master-style planners | Backlog decomposition and task state. | Complementary; Harness does not own backlog state. |
|
|
154
|
-
| Context7/Serena-style retrieval | External docs, symbols or repository retrieval. | Complementary; Harness owns local intended boundaries. |
|
|
155
|
-
|
|
156
|
-
## Minimal Context
|
|
157
|
-
|
|
158
|
-
The default read path is:
|
|
159
|
-
|
|
160
|
-
```text
|
|
161
|
-
project_context/global.md
|
|
162
|
-
project_context/architecture.md
|
|
163
|
-
project_context/context.toml
|
|
164
|
-
minimum graph-relevant area/role Context
|
|
165
|
-
```
|
|
166
|
-
|
|
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
|
-
|
|
169
|
-
`ty-context doctor` reports the deterministic default read footprint, per-file/total soft-budget overages and byte-identical default files. These are advisory maintenance signals, not a new validation gate or workflow state.
|
|
170
|
-
|
|
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
|
-
|
|
173
|
-
Every engineering handoff reports one Context result:
|
|
174
|
-
|
|
175
|
-
```text
|
|
176
|
-
Context: updated <files/reason>
|
|
177
|
-
# or
|
|
178
|
-
Context: no durable fact change
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Default Workflow Contract
|
|
182
|
-
|
|
183
|
-
Ordinary tasks stay lightweight:
|
|
184
|
-
|
|
185
|
-
1. read core/default Context and collect manifest candidates;
|
|
186
|
-
2. run one bounded Context search over `project_context/**` and read only relevant matches;
|
|
187
|
-
3. decide `Context Delta: none|required`;
|
|
188
|
-
4. update owning Context first when durable semantics change;
|
|
189
|
-
5. use the platform's internal plan;
|
|
190
|
-
6. implement and run project-owned verification;
|
|
191
|
-
7. perform Contract Conformance and Context drift checks.
|
|
192
|
-
|
|
193
|
-
The default workflow creates no required `plan.md`, matrix, verdict, evidence ledger, persistent Context-search index or second execution plan. Task length, file count and complexity never auto-enable long-task state.
|
|
194
|
-
|
|
195
|
-
Plan Validator commands no longer exist; existing plan, matrix or verdict files remain ordinary user files.
|
|
196
|
-
|
|
197
|
-
### Architecture And Modularity Guidance
|
|
198
|
-
|
|
199
|
-
Technical architecture support is a Minimal Context capability. For high-risk work, `Architecture Context Hit`, `Decision Rationale Hit: existing|required|none` and `Modularity Check: none|required|exception` are internal routing questions inside the platform's internal plan. No Task Contract or fixed `plan.md` is required. The architecture gate is risk-triggered for durable module/capability boundaries, public API/schema/data or persistence, source-of-truth/state ownership, dependency direction, cross-area work, migration/security/recovery and reusable abstractions. It resolves owner, unique source of truth, dependency direction, interface/state lifecycle, failure/recovery/compatibility, forbidden shortcuts and the project-owned executable check that protects the boundary. Small fixes do not pay this ceremony.
|
|
200
|
-
|
|
201
|
-
Do not invent rationale: store stable reasons, rejected alternatives or tradeoffs only in the smallest durable Context surface, and remember that architecture Context does not prove product quality. Harness may route repository-native lint/AST/dependency/contract checks, but it does not become a language-generic architecture analyzer.
|
|
202
|
-
|
|
203
|
-
`ty-context check-modularity` audits selected handwritten source and identifies the highest-risk function and line for statement/branch findings. `validate-code-modularity` and `validate-harness` enforce it separately from `validate-context`.
|
|
204
|
-
|
|
205
|
-
#### Modularity Policy
|
|
206
|
-
|
|
207
|
-
Newly generated Harness configs default to `strict_except_generated`. Generated/build files remain excluded; `strict_except_generated` rejects configured `modularity.waivers`. Projects with bounded legacy exceptions may opt into `scoped_waivers`, whose entries require `path`, `category`, `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
|
|
208
|
-
|
|
209
|
-
### Product Surface Contract
|
|
210
|
-
|
|
211
|
-
`context_surface_contract` compiles durable screen/page/CLI responsibility using the existing `contract`, area/subdomain and verification roles; `product-surface-contract.md` is the package template. Product Surface Contract authoring uses Source-to-Context judgment and Contract Conformance; it must not add a new product-surface Context role or claim product-quality proof.
|
|
212
|
-
|
|
213
|
-
### Visual Delivery Guidance
|
|
214
|
-
|
|
215
|
-
For material design-system, redesign, high-fidelity or visual-polish 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. It is internal planning, not a required matrix or authority. Durable surface/interaction facts remain in `project_context/**`; durable visual-system semantics and rationale remain in `DESIGN.md`; the project names one authored exact token source and generation direction. `context_development_engineer` binds that intent to production components/routes and reports only combinations actually rendered and checked, so a detached static kit or mock cannot substitute for product UI evidence.
|
|
216
|
-
|
|
217
|
-
An explicit Long-Task expresses material visual expectations through the existing Requirement, Control, Assertion, `ui_browser`, verification-input and `external_confirmation` mechanisms. Acceptance-affecting screenshot baselines are frozen verifier inputs, generated screenshots/diffs are review artifacts, and subjective design or new-baseline approval remains external. This guidance adds no visual Schema, risk level, lifecycle state, Gate or required artifact and does not change the default Workflow Contract.
|
|
218
|
-
|
|
219
|
-
### Optional Source Plan Authoring
|
|
220
|
-
|
|
221
|
-
Use `/source-plan-authoring` when explicitly asking for an initial plan, Source Plan, source draft, or synthesis/refinement/audit of later implementation or Contract-authoring Source. The input may be one substantially complete plan or a sparse goal plus mixed notes, product/technical documents, screenshots, diagrams and other attachments. A short request that identifies the artifact roles, product goal, reference authority and desired elaboration is enough; no fixed intake questionnaire or pre-normalized outline is required.
|
|
222
|
-
|
|
223
|
-
It outputs one self-contained Markdown Source Plan that:
|
|
224
|
-
|
|
225
|
-
- inventories every supplied artifact, inspects all material pages/frames/screens and records coverage gaps instead of silently sampling;
|
|
226
|
-
- preserves direct requirements and their qualifiers;
|
|
227
|
-
- marks necessary derivations and cites what they derive from;
|
|
228
|
-
- before comparative research or a material product, technical, architecture or provider selection, asks a concise targeted question when an unknown user priority such as quality versus cost, speed, reliability, privacy, lock-in or operational burden could change the research scope, candidate set or recommendation; it does not re-ask known preferences or interrupt minor reversible choices;
|
|
229
|
-
- after the preference envelope is clear, decides what research is needed, uses current authoritative or primary sources for external capability/pricing/quota/license/compatibility/region/security/support claims, and treats a request to synthesize, refine, complete or use judgment as plan-level delegation: one supported recommendation is recorded as `delegated` with its instruction, preference/evidence basis and exact meaning instead of asking for approval, including high-impact plan semantics; real payment, contracting, production release, destructive production mutation, permission grants, sensitive-data transmission and required legal/security/human approval remain `EXT`, while only conflicts, user-reserved choices, missing material preferences or cases with no defensible recommendation remain `DEC`/`decision_required`;
|
|
230
|
-
- splits Outcomes only by independently decidable observable results;
|
|
231
|
-
- uses stable semantic keys and explicit anchors for important Source items;
|
|
232
|
-
- separates mandatory `OBL` obligations from advisory `HINT` suggestions;
|
|
233
|
-
- for interactive products, inventories every in-scope surface and material control, then independently records its surface/region/type/label, placement, task, visibility/availability, trigger/input/validation/default, interaction/navigation, loading/empty/success/failure/recovery/permission/feedback and accessibility fields;
|
|
234
|
-
- uses `NCOMP` for explicit results that must not count as completion;
|
|
235
|
-
- states each `RISK` Fact, one Affected Outcome, Basis and Consequence, or emits `DEC` when the pair is unknown; Fact is exactly one of `public_api_or_schema_change`, `persistent_data_change`, `data_migration`, `security_boundary_change`, `permission_boundary_change`, `irreversible_external_effect`, `critical_user_path`, `full_population_operation`, `multi_repository_change` or `weak_observability`;
|
|
236
|
-
- writes one Given/When/Then scenario per `AC`, names its accepted `REQ`/`CTRL`/`OBL`/`NCOMP` keys, hides no new requirement in AC text and reports whether the document is ready for Contract authoring.
|
|
237
|
-
|
|
238
|
-
It does not update project Context, bind real repository owners/paths/runners, generate Delivery Contract YAML, run implementation, create workflow state or claim completion. `HINT` is not a Material Source Item, and Source Plan authoring emits no `ty-source-item` markers; repository-aware Long-Task authoring inserts markers later. A Source Plan is Source, not a Contract Draft. Its structure is an authoring fast path, not a required input protocol; ordinary prose plans remain valid Long-Task Source.
|
|
239
|
-
|
|
240
|
-
## Single-Goal Rolling Delivery
|
|
241
|
-
|
|
242
|
-
Use `/long-task-workflow` only when explicitly requested or when the current worktree already has an active long task. It uses:
|
|
243
|
-
|
|
244
|
-
- one platform-native continuing Goal;
|
|
245
|
-
- one user-selected repository/worktree;
|
|
246
|
-
- one complete selected delivery, one Contract and one Final Gate;
|
|
247
|
-
- Outcome dependencies as acceptance readiness, not worker scheduling;
|
|
248
|
-
- one user model-choice checkpoint after first Authority Lock and before implementation;
|
|
249
|
-
- a rolling internal implementation Frontier;
|
|
1
|
+
# Project Tiny Context Harness
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/project-tiny-context-harness)
|
|
4
|
+
[](https://github.com/Seven128/project-tiny-context-harness/actions/workflows/package.yml)
|
|
5
|
+
[](https://securityscorecards.dev/viewer/?uri=github.com/Seven128/project-tiny-context-harness)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://codespaces.new/Seven128/project-tiny-context-harness)
|
|
8
|
+
|
|
9
|
+
Translations: [Chinese (Simplified)](README.zh-CN.md)
|
|
10
|
+
|
|
11
|
+
Project Tiny Context Harness is repo-native project memory for AI coding agents, plus a narrow delivery harness for trustworthy long-task completion. The product principle is: keep the memory, drop the ceremony. It adds durable project memory behind `AGENTS.md` without becoming an agent scheduler or Git orchestrator.
|
|
12
|
+
|
|
13
|
+
Public launch surfaces are English-first; localized documents are secondary entry points.
|
|
14
|
+
|
|
15
|
+
Best for:
|
|
16
|
+
|
|
17
|
+
- repositories where coding agents repeatedly rediscover project intent;
|
|
18
|
+
- teams using multiple agents or frequent fresh chats;
|
|
19
|
+
- maintainers who want durable Context and explicit long-task evidence.
|
|
20
|
+
|
|
21
|
+
Not for:
|
|
22
|
+
|
|
23
|
+
- replacing project tests, review, CI or human acceptance;
|
|
24
|
+
- autonomous Tiny Context execution;
|
|
25
|
+
- codebase semantic indexing or external docs retrieval.
|
|
26
|
+
|
|
27
|
+
Concrete shift:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Before: ask a fresh agent to read the repo and tell you what matters.
|
|
31
|
+
After: ask it to read AGENTS.md and project_context/** first, then summarize goal, non-goals, architecture boundaries and validation paths before proposing code.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
What gets added:
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
flowchart LR
|
|
38
|
+
A["Fresh agent session"] --> B["AGENTS.md startup router"]
|
|
39
|
+
B --> C["project_context/** durable facts"]
|
|
40
|
+
C --> D["Goal, boundaries, validation paths"]
|
|
41
|
+
D --> E["Implementation and delivery work"]
|
|
42
|
+
F["Tests / CI / review"] --> G["Product quality evidence"]
|
|
43
|
+
C -. "does not own" .-> G
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
The demo shows the core loop: initialize `AGENTS.md` and `project_context/**`, run `validate-context`, then ask a fresh agent to recover intent before proposing code. Use the npm install path below, or inspect the no-install previews first.
|
|
49
|
+
|
|
50
|
+
Install:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npm install -D project-tiny-context-harness@latest
|
|
54
|
+
npx --yes --package project-tiny-context-harness@latest ty-context init
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
No-install preview:
|
|
58
|
+
|
|
59
|
+
- Read the [fresh-agent recovery walkthrough](docs/examples/fresh-agent-recovery.md).
|
|
60
|
+
- Inspect the [Minimal Context sample guide](docs/examples/minimal-context-sample.md).
|
|
61
|
+
- Browse the tiny generated repository at [examples/minimal-context-sample/](examples/minimal-context-sample/).
|
|
62
|
+
|
|
63
|
+
## Why It Exists
|
|
64
|
+
|
|
65
|
+
Coding agents need two different kinds of help:
|
|
66
|
+
|
|
67
|
+
- durable facts that survive sessions without loading the whole repository;
|
|
68
|
+
- trustworthy completion checks when a task spans many edits or context compactions.
|
|
69
|
+
|
|
70
|
+
Tiny Context keeps those concerns narrow. `project_context/**` records durable ownership, architecture, contracts and repeatable verification. The default Workflow Contract combines manifest routing with one bounded Context search before `Context Delta`. The explicit Long-Task Workflow adds one machine-checked Delivery Contract, a one-time post-Authority-Lock model choice, rolling repair verification, a same-snapshot Final Gate and Stop freshness.
|
|
71
|
+
|
|
72
|
+
It does not launch or switch models, spawn agents, create branches or worktrees, merge, push, open pull requests, deploy, or claim to replace project tests and human acceptance.
|
|
73
|
+
|
|
74
|
+
## Capability Model
|
|
75
|
+
|
|
76
|
+
1. **Minimal Context** — small, role-aware durable facts under `project_context/**`.
|
|
77
|
+
2. **Workflow Contract** — Context-first default engineering behavior using the platform's internal plan; no required plan artifact.
|
|
78
|
+
3. **Long-Task Workflow** — explicit Single-Goal Rolling Delivery with `long-task-delivery-v2`, compiled Claim Coverage and a verifier-owned Live Final Gate.
|
|
79
|
+
|
|
80
|
+
The opt-in long-task profile also provides `/source-plan-authoring`, an upstream Source-quality helper rather than another authority layer.
|
|
81
|
+
|
|
82
|
+
Default profiles are `core-portable` and `workflow-default`. Enable the opt-in profile with:
|
|
83
|
+
|
|
84
|
+
```powershell
|
|
85
|
+
ty-context enable long-task
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This installs `/source-plan-authoring`, `/long-task-workflow` and the completion Hook. It does not install an agent runtime, model worker, scheduler, or Git orchestration assets.
|
|
89
|
+
|
|
90
|
+
## Try It In 60 Seconds
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
mkdir project-tiny-context-harness-demo
|
|
94
|
+
cd project-tiny-context-harness-demo
|
|
95
|
+
git init
|
|
96
|
+
npm init -y
|
|
97
|
+
npm install -D project-tiny-context-harness@latest
|
|
98
|
+
npx --yes --package project-tiny-context-harness@latest ty-context init
|
|
99
|
+
make validate-context
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Then open `AGENTS.md`, `project_context/global.md` and `project_context/architecture.md`.
|
|
103
|
+
|
|
104
|
+
Expected result:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
AGENTS.md
|
|
108
|
+
project_context/
|
|
109
|
+
context.toml
|
|
110
|
+
global.md
|
|
111
|
+
architecture.md
|
|
112
|
+
areas/main.md
|
|
113
|
+
areas/main/verification.md
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Fresh-agent test prompt:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
Read AGENTS.md and project_context/** first. Summarize the project goal, non-goals, architecture boundaries, validation entry points and next safe action before proposing code changes.
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For an existing repository, use `npx --yes --package project-tiny-context-harness@latest ty-context init --adopt`.
|
|
123
|
+
|
|
124
|
+
### Source checkout preview:
|
|
125
|
+
|
|
126
|
+
Open <https://codespaces.new/Seven128/project-tiny-context-harness>, or run locally:
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
git clone https://github.com/Seven128/project-tiny-context-harness.git
|
|
130
|
+
cd project-tiny-context-harness
|
|
131
|
+
npm ci
|
|
132
|
+
npm run smoke:quickstart
|
|
133
|
+
npm run preview:pack
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The smoke packs the local workspace, installs it into a disposable repo and validates the generated Minimal Context files. Use this path for package development, source-preview testing or private review.
|
|
137
|
+
|
|
138
|
+
```sh
|
|
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.1.tgz
|
|
141
|
+
npx --no-install ty-context init --adopt
|
|
142
|
+
make validate-context
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
If it fails, open a [Source preview report](https://github.com/Seven128/project-tiny-context-harness/issues/new?template=source_preview_report.yml).
|
|
146
|
+
|
|
147
|
+
## Positioning
|
|
148
|
+
|
|
149
|
+
| Adjacent tool type | Use it for | Harness stance |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| Spec-first kits | Turning a feature idea into structured specs and plans. | Complementary; Harness keeps durable repo facts beyond one feature spec. |
|
|
152
|
+
| BMAD-style workflows and full Tiny Context processes | Role/process ceremony for selected work. | Lighter default; ordinary work stays Context-first. |
|
|
153
|
+
| Task Master-style planners | Backlog decomposition and task state. | Complementary; Harness does not own backlog state. |
|
|
154
|
+
| Context7/Serena-style retrieval | External docs, symbols or repository retrieval. | Complementary; Harness owns local intended boundaries. |
|
|
155
|
+
|
|
156
|
+
## Minimal Context
|
|
157
|
+
|
|
158
|
+
The default read path is:
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
project_context/global.md
|
|
162
|
+
project_context/architecture.md
|
|
163
|
+
project_context/context.toml
|
|
164
|
+
minimum graph-relevant area/role Context
|
|
165
|
+
```
|
|
166
|
+
|
|
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
|
+
|
|
169
|
+
`ty-context doctor` reports the deterministic default read footprint, per-file/total soft-budget overages and byte-identical default files. These are advisory maintenance signals, not a new validation gate or workflow state.
|
|
170
|
+
|
|
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
|
+
|
|
173
|
+
Every engineering handoff reports one Context result:
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
Context: updated <files/reason>
|
|
177
|
+
# or
|
|
178
|
+
Context: no durable fact change
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Default Workflow Contract
|
|
182
|
+
|
|
183
|
+
Ordinary tasks stay lightweight:
|
|
184
|
+
|
|
185
|
+
1. read core/default Context and collect manifest candidates;
|
|
186
|
+
2. run one bounded Context search over `project_context/**` and read only relevant matches;
|
|
187
|
+
3. decide `Context Delta: none|required`;
|
|
188
|
+
4. update owning Context first when durable semantics change;
|
|
189
|
+
5. use the platform's internal plan;
|
|
190
|
+
6. implement and run project-owned verification;
|
|
191
|
+
7. perform Contract Conformance and Context drift checks.
|
|
192
|
+
|
|
193
|
+
The default workflow creates no required `plan.md`, matrix, verdict, evidence ledger, persistent Context-search index or second execution plan. Task length, file count and complexity never auto-enable long-task state.
|
|
194
|
+
|
|
195
|
+
Plan Validator commands no longer exist; existing plan, matrix or verdict files remain ordinary user files.
|
|
196
|
+
|
|
197
|
+
### Architecture And Modularity Guidance
|
|
198
|
+
|
|
199
|
+
Technical architecture support is a Minimal Context capability. For high-risk work, `Architecture Context Hit`, `Decision Rationale Hit: existing|required|none` and `Modularity Check: none|required|exception` are internal routing questions inside the platform's internal plan. No Task Contract or fixed `plan.md` is required. The architecture gate is risk-triggered for durable module/capability boundaries, public API/schema/data or persistence, source-of-truth/state ownership, dependency direction, cross-area work, migration/security/recovery and reusable abstractions. It resolves owner, unique source of truth, dependency direction, interface/state lifecycle, failure/recovery/compatibility, forbidden shortcuts and the project-owned executable check that protects the boundary. Small fixes do not pay this ceremony.
|
|
200
|
+
|
|
201
|
+
Do not invent rationale: store stable reasons, rejected alternatives or tradeoffs only in the smallest durable Context surface, and remember that architecture Context does not prove product quality. Harness may route repository-native lint/AST/dependency/contract checks, but it does not become a language-generic architecture analyzer.
|
|
202
|
+
|
|
203
|
+
`ty-context check-modularity` audits selected handwritten source and identifies the highest-risk function and line for statement/branch findings. `validate-code-modularity` and `validate-harness` enforce it separately from `validate-context`.
|
|
204
|
+
|
|
205
|
+
#### Modularity Policy
|
|
206
|
+
|
|
207
|
+
Newly generated Harness configs default to `strict_except_generated`. Generated/build files remain excluded; `strict_except_generated` rejects configured `modularity.waivers`. Projects with bounded legacy exceptions may opt into `scoped_waivers`, whose entries require `path`, `category`, `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
|
|
208
|
+
|
|
209
|
+
### Product Surface Contract
|
|
210
|
+
|
|
211
|
+
`context_surface_contract` compiles durable screen/page/CLI responsibility using the existing `contract`, area/subdomain and verification roles; `product-surface-contract.md` is the package template. Product Surface Contract authoring uses Source-to-Context judgment and Contract Conformance; it must not add a new product-surface Context role or claim product-quality proof.
|
|
212
|
+
|
|
213
|
+
### Visual Delivery Guidance
|
|
214
|
+
|
|
215
|
+
For material design-system, redesign, high-fidelity or visual-polish 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. It is internal planning, not a required matrix or authority. Durable surface/interaction facts remain in `project_context/**`; durable visual-system semantics and rationale remain in `DESIGN.md`; the project names one authored exact token source and generation direction. `context_development_engineer` binds that intent to production components/routes and reports only combinations actually rendered and checked, so a detached static kit or mock cannot substitute for product UI evidence.
|
|
216
|
+
|
|
217
|
+
An explicit Long-Task expresses material visual expectations through the existing Requirement, Control, Assertion, `ui_browser`, verification-input and `external_confirmation` mechanisms. Acceptance-affecting screenshot baselines are frozen verifier inputs, generated screenshots/diffs are review artifacts, and subjective design or new-baseline approval remains external. This guidance adds no visual Schema, risk level, lifecycle state, Gate or required artifact and does not change the default Workflow Contract.
|
|
218
|
+
|
|
219
|
+
### Optional Source Plan Authoring
|
|
220
|
+
|
|
221
|
+
Use `/source-plan-authoring` when explicitly asking for an initial plan, Source Plan, source draft, or synthesis/refinement/audit of later implementation or Contract-authoring Source. The input may be one substantially complete plan or a sparse goal plus mixed notes, product/technical documents, screenshots, diagrams and other attachments. A short request that identifies the artifact roles, product goal, reference authority and desired elaboration is enough; no fixed intake questionnaire or pre-normalized outline is required.
|
|
222
|
+
|
|
223
|
+
It outputs one self-contained Markdown Source Plan that:
|
|
224
|
+
|
|
225
|
+
- inventories every supplied artifact, inspects all material pages/frames/screens and records coverage gaps instead of silently sampling;
|
|
226
|
+
- preserves direct requirements and their qualifiers;
|
|
227
|
+
- marks necessary derivations and cites what they derive from;
|
|
228
|
+
- before comparative research or a material product, technical, architecture or provider selection, asks a concise targeted question when an unknown user priority such as quality versus cost, speed, reliability, privacy, lock-in or operational burden could change the research scope, candidate set or recommendation; it does not re-ask known preferences or interrupt minor reversible choices;
|
|
229
|
+
- after the preference envelope is clear, decides what research is needed, uses current authoritative or primary sources for external capability/pricing/quota/license/compatibility/region/security/support claims, and treats a request to synthesize, refine, complete or use judgment as plan-level delegation: one supported recommendation is recorded as `delegated` with its instruction, preference/evidence basis and exact meaning instead of asking for approval, including high-impact plan semantics; real payment, contracting, production release, destructive production mutation, permission grants, sensitive-data transmission and required legal/security/human approval remain `EXT`, while only conflicts, user-reserved choices, missing material preferences or cases with no defensible recommendation remain `DEC`/`decision_required`;
|
|
230
|
+
- splits Outcomes only by independently decidable observable results;
|
|
231
|
+
- uses stable semantic keys and explicit anchors for important Source items;
|
|
232
|
+
- separates mandatory `OBL` obligations from advisory `HINT` suggestions;
|
|
233
|
+
- for interactive products, inventories every in-scope surface and material control, then independently records its surface/region/type/label, placement, task, visibility/availability, trigger/input/validation/default, interaction/navigation, loading/empty/success/failure/recovery/permission/feedback and accessibility fields;
|
|
234
|
+
- uses `NCOMP` for explicit results that must not count as completion;
|
|
235
|
+
- states each `RISK` Fact, one Affected Outcome, Basis and Consequence, or emits `DEC` when the pair is unknown; Fact is exactly one of `public_api_or_schema_change`, `persistent_data_change`, `data_migration`, `security_boundary_change`, `permission_boundary_change`, `irreversible_external_effect`, `critical_user_path`, `full_population_operation`, `multi_repository_change` or `weak_observability`;
|
|
236
|
+
- writes one Given/When/Then scenario per `AC`, names its accepted `REQ`/`CTRL`/`OBL`/`NCOMP` keys, hides no new requirement in AC text and reports whether the document is ready for Contract authoring.
|
|
237
|
+
|
|
238
|
+
It does not update project Context, bind real repository owners/paths/runners, generate Delivery Contract YAML, run implementation, create workflow state or claim completion. `HINT` is not a Material Source Item, and Source Plan authoring emits no `ty-source-item` markers; repository-aware Long-Task authoring inserts markers later. A Source Plan is Source, not a Contract Draft. Its structure is an authoring fast path, not a required input protocol; ordinary prose plans remain valid Long-Task Source.
|
|
239
|
+
|
|
240
|
+
## Single-Goal Rolling Delivery
|
|
241
|
+
|
|
242
|
+
Use `/long-task-workflow` only when explicitly requested or when the current worktree already has an active long task. It uses:
|
|
243
|
+
|
|
244
|
+
- one platform-native continuing Goal;
|
|
245
|
+
- one user-selected repository/worktree;
|
|
246
|
+
- one complete selected delivery, one Contract and one Final Gate;
|
|
247
|
+
- Outcome dependencies as acceptance readiness, not worker scheduling;
|
|
248
|
+
- one user model-choice checkpoint after first Authority Lock and before implementation;
|
|
249
|
+
- a rolling internal implementation Frontier;
|
|
250
250
|
- targeted repair checks that never accept;
|
|
251
251
|
- stateless scope-only revision diagnosis before one exact approval;
|
|
252
|
-
- a complete Final Gate on one current snapshot;
|
|
253
|
-
- a Stop Hook that rejects stale completion.
|
|
254
|
-
|
|
255
|
-
Long-Task Contract authoring preserves stable Source keys and anchors where practical. If an unknown preference could materially change comparative research or selection, it asks before proceeding. Once the decision criteria are clear, a defensible recommended plan choice is written into real Source with its delegation, preference/evidence basis and exact meaning before Contract mapping; it is never hidden only in YAML. That plan delegation does not authorize a real high-risk external action, which remains an explicit external confirmation. Meaning-preserving structural decomposition and evidence-backed repository binding may continue; conflicting, user-reserved, missing-preference or unsupported new product semantics remain `decision_required`. Missing recommended Source Plan structure never blocks authoring, but the marker-only Material Source Item enumeration required for activation does.
|
|
256
|
-
|
|
257
|
-
Before the first successful formal Compile, `delivery-contract.yaml` is one non-authoritative Contract Draft. `/long-task-workflow` keeps revising that same Draft across repository/Context reads and Preflight repair rounds; it does not require one response to produce a complete Contract. Draft authoring is integrated because repository bindings and verification inputs need real evidence, Preflight findings must feed back into the same object, and a separate handoff would risk lost meaning or a second plan/authority. No standalone Contract Draft Skill, Draft Receipt or Authoring State exists.
|
|
258
|
-
|
|
252
|
+
- a complete Final Gate on one current snapshot;
|
|
253
|
+
- a Stop Hook that rejects stale completion.
|
|
254
|
+
|
|
255
|
+
Long-Task Contract authoring preserves stable Source keys and anchors where practical. If an unknown preference could materially change comparative research or selection, it asks before proceeding. Once the decision criteria are clear, a defensible recommended plan choice is written into real Source with its delegation, preference/evidence basis and exact meaning before Contract mapping; it is never hidden only in YAML. That plan delegation does not authorize a real high-risk external action, which remains an explicit external confirmation. Meaning-preserving structural decomposition and evidence-backed repository binding may continue; conflicting, user-reserved, missing-preference or unsupported new product semantics remain `decision_required`. Missing recommended Source Plan structure never blocks authoring, but the marker-only Material Source Item enumeration required for activation does.
|
|
256
|
+
|
|
257
|
+
Before the first successful formal Compile, `delivery-contract.yaml` is one non-authoritative Contract Draft. `/long-task-workflow` keeps revising that same Draft across repository/Context reads and Preflight repair rounds; it does not require one response to produce a complete Contract. Draft authoring is integrated because repository bindings and verification inputs need real evidence, Preflight findings must feed back into the same object, and a separate handoff would risk lost meaning or a second plan/authority. No standalone Contract Draft Skill, Draft Receipt or Authoring State exists.
|
|
258
|
+
|
|
259
259
|
The first successful Compile creates Authority Lock and returns `execution_model_checkpoint.required: true`. Before implementation, the Agent asks the user to `continue_current_model` or switch models and then resume the active Long-Task. A task-specific model strategy already stated explicitly satisfies the checkpoint. Later Compile revisions return `required: false`; Harness does not switch models, persist acknowledgement/model-route state or repeat the pause.
|
|
260
260
|
|
|
261
261
|
Later revisions are classified into three paths. Formally monotonic evidence strengthening and other proven mechanical-safe changes auto-adopt. A candidate whose only protected reasons are owner, expected-change or allowed-support expansion may be exercised through `diagnose-revision` using existing active Check identities whose runner and verifier are unchanged; safe monotonic strengthening may coexist, and the results remain transient repair diagnostics rather than Progress or acceptance. Product/Source/Acceptance semantic changes, proof weakening, verifier-content or runner changes, and risk increases are preview-only and require the exact revision identity; risk downgrade remains rejected outright. Diagnosis never changes the active Authority or writes pending/approval state, cache, Progress or Receipt, so related edits can accumulate in the same `delivery-contract.yaml` before one `compile --revise` approval request. The pending decision contains a concise hash-bound summary and is projected by `status`/`resume`; adoption invalidates derived evidence and the complete Final Gate remains mandatory.
|
|
262
|
-
|
|
263
|
-
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
|
-
|
|
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 is temporary. An Outcome is not a Worker, scheduler task, queue or parallelism unit. Outcome decomposes execution and diagnosis, not completion authority: targeted passes never replace the one complete Final Gate on the current final snapshot.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
262
|
+
|
|
263
|
+
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
|
+
|
|
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 is temporary. An Outcome is not a Worker, scheduler task, queue or parallelism unit. Outcome decomposes execution and diagnosis, not completion authority: targeted passes never replace the one complete Final Gate on the current final snapshot.
|
|
266
|
+
|
|
267
|
+
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. The Goal runs that Check after the first runnable slice and, after coalescing related edits, before dependent work grows when declared `input_paths` or Binding carriers make Progress stale. This uses existing targeted verification and Final Gate semantics: it adds no `platform_impact` flags or completion state, requires no full rebuild per Outcome/edit, never accepts early and is rerun by Final Gate.
|
|
268
|
+
|
|
269
|
+
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.
|
|
270
|
+
|
|
271
|
+
### CLI
|
|
272
|
+
|
|
273
|
+
```text
|
|
274
|
+
ty-context long-task init <workdir>
|
|
275
|
+
ty-context long-task preflight <workdir>
|
|
274
276
|
ty-context long-task compile <workdir>
|
|
275
277
|
ty-context long-task compile <workdir> --revise
|
|
276
278
|
ty-context long-task diagnose-revision <workdir> [--outcome <key>] [--check <key>]
|
|
277
279
|
ty-context long-task approve-authority-revision <workdir> --revision <sha>
|
|
278
|
-
ty-context long-task explain <workdir>
|
|
279
|
-
ty-context long-task verify <workdir> [--outcome <key>] [--check <key>]
|
|
280
|
-
ty-context long-task status <workdir>
|
|
281
|
-
ty-context long-task resume <workdir>
|
|
282
|
-
ty-context long-task doctor <workdir>
|
|
283
|
-
ty-context long-task final-gate <workdir>
|
|
284
|
-
ty-context long-task stop-check <workdir> [--message <text>]
|
|
285
|
-
ty-context long-task close <workdir>
|
|
286
|
-
ty-context long-task abandon <workdir> [--force-corrupt-state]
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
- `init` creates one Compact inline-Outcome Contract template.
|
|
290
|
-
- `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.
|
|
280
|
+
ty-context long-task explain <workdir>
|
|
281
|
+
ty-context long-task verify <workdir> [--outcome <key>] [--check <key>]
|
|
282
|
+
ty-context long-task status <workdir>
|
|
283
|
+
ty-context long-task resume <workdir>
|
|
284
|
+
ty-context long-task doctor <workdir>
|
|
285
|
+
ty-context long-task final-gate <workdir>
|
|
286
|
+
ty-context long-task stop-check <workdir> [--message <text>]
|
|
287
|
+
ty-context long-task close <workdir>
|
|
288
|
+
ty-context long-task abandon <workdir> [--force-corrupt-state]
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
- `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.
|
|
291
293
|
- `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. 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.
|
|
292
294
|
- `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`.
|
|
293
295
|
- `compile --revise` auto-adopts proven-safe revisions. Protected revisions return `authority_revision_pending` on stdout plus the exact decision id and deterministic approval summary, then fail closed until `approve-authority-revision` approves that exact id. Candidate edits produce a new id and invalidate the old approval.
|
|
294
|
-
- `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.
|
|
295
|
-
- `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. It reads the common-dir authority snapshot and reports a missing or mismatched workdir cache as a repairable diagnostic.
|
|
296
|
+
- `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.
|
|
296
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.
|
|
297
|
-
- `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.
|
|
298
|
-
- `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. When machine scope passes with external work pending, the Stop Hook allows stopping but shows a non-blocking `systemMessage`; `close` returns `workflow_status` plus all `external_confirmations`. `status: closed` means only that machine Authority was cleared, not that complete external delivery finished.
|
|
299
|
-
- `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.
|
|
300
|
-
|
|
301
|
-
### Delivery Contract
|
|
302
|
-
|
|
303
|
-
`long-task-delivery-v2` keeps Product Authority, Technical Boundary Authority and Acceptance Authority as logical sections of one file. Compact YAML omits only deterministic defaults; the normalized Contract and all hashes are identical to the expanded form. The compiler derives machine Claims for observable results, atomic Requirements, control fields including location, non-completing outcomes, technical obligations and forbidden shortcuts:
|
|
304
|
-
|
|
305
|
-
<!-- long-task-public-contract-example:start -->
|
|
306
|
-
```yaml
|
|
307
|
-
schema_version: long-task-delivery-v2
|
|
308
|
-
task:
|
|
309
|
-
id: example-task
|
|
310
|
-
title: Example task
|
|
311
|
-
goal: Complete observable delivery goal
|
|
312
|
-
source_paths: [plans/example.md]
|
|
313
|
-
context_refs: [project_context/areas/main.md]
|
|
314
|
-
source_claims:
|
|
315
|
-
- key: observable-requirement
|
|
316
|
-
source_ref: plans/example.md#observable-requirement
|
|
317
|
-
statement: The outcome is observable.
|
|
318
|
-
disposition:
|
|
319
|
-
type: claim
|
|
320
|
-
refs: [observable-outcome.requirement.observable]
|
|
321
|
-
risk:
|
|
322
|
-
facts: {}
|
|
323
|
-
global: {}
|
|
324
|
-
outcomes:
|
|
325
|
-
- key: observable-outcome
|
|
326
|
-
title: Observable outcome
|
|
327
|
-
product:
|
|
328
|
-
observable_result: What a user or system can observe
|
|
329
|
-
owner:
|
|
330
|
-
label: Owning product or module boundary
|
|
331
|
-
context_refs: [project_context/areas/main.md]
|
|
332
|
-
path_globs: ["src/**", "tests/**"]
|
|
333
|
-
requirements:
|
|
334
|
-
- key: observable
|
|
335
|
-
statement: The outcome is observable.
|
|
336
|
-
required_proof_surfaces: [runtime_behavior]
|
|
337
|
-
technical:
|
|
338
|
-
expected_change_paths: ["src/**"]
|
|
339
|
-
bindings:
|
|
340
|
-
- key: observable-carrier
|
|
341
|
-
kind: file
|
|
342
|
-
target: src/observable.ts
|
|
343
|
-
carrier_paths: [src/observable.ts]
|
|
344
|
-
existence: planned
|
|
345
|
-
acceptance:
|
|
346
|
-
checks:
|
|
347
|
-
- key: runtime
|
|
348
|
-
proof_surface: runtime_behavior
|
|
349
|
-
runner:
|
|
350
|
-
type: node_oracle
|
|
351
|
-
target: tests/runtime.mjs
|
|
352
|
-
effect: read_only
|
|
353
|
-
verification_inputs: [tests/runtime.mjs]
|
|
354
|
-
input_paths: [src/observable.ts]
|
|
355
|
-
expected_output_paths: [src/observable.ts]
|
|
356
|
-
positive_assertions:
|
|
357
|
-
- key: observable-ac
|
|
358
|
-
criterion: The declared requirement is observable.
|
|
359
|
-
claims: [result, requirement.observable]
|
|
360
|
-
observation: result
|
|
361
|
-
operator: equals
|
|
362
|
-
expected: true
|
|
363
|
-
counterfactual_controls:
|
|
364
|
-
- key: remove-observable-carrier
|
|
365
|
-
binding_key: observable-carrier
|
|
366
|
-
claims: [result, requirement.observable]
|
|
367
|
-
check_key: runtime
|
|
368
|
-
mutation:
|
|
369
|
-
type: remove_paths
|
|
370
|
-
paths: [src/observable.ts]
|
|
371
|
-
expected_assertion_failures: [observable-ac]
|
|
372
|
-
```
|
|
373
|
-
<!-- long-task-public-contract-example:end -->
|
|
374
|
-
|
|
375
|
-
Authors provide task, Outcome, control and Check keys. The compiler generates `OUT.<outcome-key>` and `CHECK.<outcome-key>.<check-key>` identities. It rejects unknown/duplicate keys, YAML aliases/tags/merges, dependency cycles, unsafe paths, missing Context/source/runner files, missing package scripts, unverifiable Outcomes, and UI Outcomes without browser proof.
|
|
376
|
-
|
|
377
|
-
Global non-goals, constraints and forbidden shortcuts generate `GLOBAL.non_goal.<key>`, `GLOBAL.constraint.<key>` and `GLOBAL.forbidden_shortcut.<key>`. They must be covered by Global Check Assertions using local refs. Non-goals and forbidden shortcuts require negative proof; constraints accept either polarity. Outcome and Global Checks cannot cross Claim scope. Global forbidden paths do not generate Claims because the changed-path boundary enforces them statically.
|
|
378
|
-
|
|
379
|
-
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.
|
|
380
|
-
|
|
381
|
-
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`.
|
|
382
|
-
|
|
383
|
-
### One Contract And Source Claims
|
|
384
|
-
|
|
385
|
-
Every complete delivery selected by the user remains one Contract and one Final Gate, even when Outcomes are weakly related. Outcome boundaries exist only for independently decidable, target-verifiable results and never for output length, YAML/file size, frontend/backend layers, module count, parallelism or Agent capacity. New authoring uses inline Outcomes. Existing `outcome_files` remains parser compatibility for physical file organization only and creates no semantic, state or completion boundary.
|
|
386
|
-
|
|
387
|
-
V2 authoring requires at least one real `source_path` and one `source_claim`. During authoring, every Material Source Item in the original Markdown is wrapped without rewriting it:
|
|
388
|
-
|
|
389
|
-
```markdown
|
|
390
|
-
<!-- ty-source-item:start key=save-failure kind=requirement -->
|
|
391
|
-
Saving failure preserves the user's input and shows the reason.
|
|
392
|
-
<!-- ty-source-item:end -->
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
Supported kinds are `outcome_result`, `requirement`, `control`, `acceptance`, `technical_obligation`, `non_completing`, `non_goal`, `forbidden_shortcut`, `risk_fact`, `external_confirmation` and `decision`. A risk marker additionally carries its exact pair, for example `<!-- ty-source-item:start key=permission-risk kind=risk_fact fact=permission_boundary_change outcome=observable-outcome -->`. Every declared Source file contains at least one Material Item; background-only references stay outside Source Authority. Marker keys and Source Claim keys must be set-equal and globally unique across all Source files. Nested, overlapping, unclosed, empty or invalid markers fail Compile. Each `source_claim.statement` must match the marked text after only line-ending, surrounding-blank-line and trailing-space normalization.
|
|
396
|
-
|
|
397
|
-
Typed dispositions keep overall results, Requirement/Control/Obligation/Non-completing Claims, one named Acceptance Assertion, Global constraints/non-goals, declared Fact/Affected-Outcome risk pairs, external confirmations and genuine decisions distinct. Risk marker metadata must exactly equal its disposition and declared risk fact, and each Fact/Outcome pair has one Source owner. Source Plan and Runtime use the same ten Fact names: data migration is `data_migration`, a weakly observable critical path is two independent `critical_user_path` and `weak_observability` items, and `multi_repository_change` stays in Source until Compiler rejection. Every other non-decision Source item owns exactly one canonical target of the same kind and normalized text, and no target may have two Source owners. An Outcome Source acceptance maps to one `<outcome>.<check>.<assertion>` whose criterion is text-identical and which proves an independently Source-backed non-Result Claim. A Global Source acceptance maps to `GLOBAL.<check>.<assertion>`, is also criterion-identical, proves no Outcome Claim and includes at least one independently Source-backed Global non-goal, constraint or forbidden-shortcut Claim. `out_of_scope` is retired: an explicit Source non-goal needs covered negative proof, while excluding an in-scope item requires `decision_required`. Ordinary prose and Source Plans remain valid after marker-only enumeration; Compiler coverage is honest about being unable to discover unmarked natural-language requirements.
|
|
398
|
-
|
|
399
|
-
Delivery Set orchestration and top-level Contract splitting within one selected delivery are retired. `ty-context delivery-set ...` returns a fixed non-executing tombstone.
|
|
400
|
-
|
|
401
|
-
Every Contract-authority, Source hash/file-set, selected Context authority structure/file-set/hash, Product/Global semantic or verifier-content change requires `--revise`; ordinary Compile cannot silently refreeze it. Retrieval-only `context.toml` changes do not revise active Authority, while selected ownership, role/dependency and content changes remain protected. After Authority Lock, reductions and Product Claim additions require approval of an exact revision identity. Pure verifier relocation and proven tightening may revise automatically.
|
|
402
|
-
|
|
403
|
-
Every path-bearing field uses one canonical grammar before hashing and matching. Windows separators and one leading `./` normalize to `/`; runner `cwd` alone may be `.`. Internal `.`/`..`, controls, empty segments, absolute/drive/UNC paths, brackets, braces, parentheses/extglob and non-segment `**` are rejected. Pattern matching, subset and overlap/disjoint use the same AST, and unknown relations fail closed.
|
|
404
|
-
|
|
405
|
-
### Deterministic Risk
|
|
406
|
-
|
|
407
|
-
- **L0**: local, reversible, directly testable work stays on the default workflow.
|
|
408
|
-
- **L1 standard**: multiple observable Outcomes or cross-session recovery, with reliable executable checks.
|
|
409
|
-
- **L2 strict**: the same Long-Task workflow and Outcome model, with stronger proof on affected public API/schema, persistent data, migration, security/permission, irreversible, full-population or weak-observability critical-path Outcomes. Multi-repository delivery is unsupported.
|
|
410
|
-
|
|
411
|
-
An explicit user request can raise the level to strict. Explicit `standard` below the computed floor fails with `risk_level_below_required`. Strict negative, counterfactual, population, security, environment and rollback/recovery obligations are compiler-enforced as applicable. Changed paths outside the declared envelope return a `scope_escape` Finding and require the same Goal to review risk/ownership, revise and recompile the Contract.
|
|
412
|
-
|
|
413
|
-
### Evidence And Authority
|
|
414
|
-
|
|
415
|
-
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 produce `structured_json_v2` for all non-browser surfaces. The adapter is part of acceptance, raw-execution, compiled, progress and Receipt identity.
|
|
416
|
-
|
|
417
|
-
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.
|
|
418
|
-
|
|
419
|
-
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` requires 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`.
|
|
420
|
-
|
|
421
|
-
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.
|
|
422
|
-
|
|
423
|
-
The workdir `.ty-context/compiled-contract.json` is only a rebuildable cache projection. Previous authority, the immutable initial base, risk floor and Final Gate identity come only from the common-dir snapshot. Commit, verifier migration, clear and abandon share one active-state lock; Final/Verify recheck identity and Stop/close use accepted-identity CAS. Development-period V2 Active Authority, Progress and Receipts are not migrated. Corrupt continuity is recovered explicitly with `abandon --force-corrupt-state`.
|
|
424
|
-
|
|
425
|
-
Final Gate may run only Contract-declared verification commands and never production mutation/deployment/payment/migration execution. Retry defaults to none and is allowed once only for `transient_once` + idempotent + read-only/test-sandbox runners. Runners receive a minimal environment whitelist plus only declared environment requirements. Protected authority/proof inputs reject symlinks and detectable hardlinks. Network isolation remains external. Receipts are audit-only (`reusable_for_acceptance: false`). Human, CI, deployment and product confirmation live only in `external_confirmations`; a machine pass with pending confirmations reports `machine_accepted_external_pending`.
|
|
426
|
-
|
|
427
|
-
## Compatibility And Migration
|
|
428
|
-
|
|
429
|
-
Version 0.6.0 retires the V1 schema/runtime and repo-local Hook. Enable, disable and upgrade remove only exact Tiny Context managed Hook entries. Relocated package-owned absolute commands are recognized only when known managed status and package layout match; similar-name user Hooks remain. Upgrade never imports V1 progress or Receipts into V2 authority. Delivery Set, `composite-campaign` and `composite-long-task` commands are non-executing tombstones.
|
|
430
|
-
|
|
431
|
-
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.
|
|
432
|
-
|
|
433
|
-
`/normal-long-task` is also a retirement pointer to `/long-task-workflow`; it creates no checklist, prompt, audit, matrix, verdict or second authority.
|
|
434
|
-
|
|
435
|
-
### Package update modes
|
|
436
|
-
|
|
437
|
-
After updating the package, run `ty-context upgrade`. Use `ty-context upgrade --check` first when you need a read-only plan.
|
|
438
|
-
|
|
439
|
-
Release metadata declares one update mode: `sync-only`, `upgrade-required` or `manual-required`. Upgrade plans report steps as `safe_pending`, `manual_required` or `blocked`. A `sync-only` release may use `sync`; `sync` does not run migrations. An `upgrade-required` release must run upgrade, while `manual-required` includes an explicit operator step.
|
|
440
|
-
|
|
441
|
-
## Development And Verification
|
|
442
|
-
|
|
443
|
-
```powershell
|
|
444
|
-
npm install
|
|
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.
|
|
300
|
+
- `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. When machine scope passes with external work pending, the Stop Hook allows stopping but shows a non-blocking `systemMessage`; `close` returns `workflow_status` plus all `external_confirmations`. `status: closed` means only that machine Authority was cleared, not that complete external delivery finished.
|
|
301
|
+
- `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
|
+
|
|
303
|
+
### Delivery Contract
|
|
304
|
+
|
|
305
|
+
`long-task-delivery-v2` keeps Product Authority, Technical Boundary Authority and Acceptance Authority as logical sections of one file. Compact YAML omits only deterministic defaults; the normalized Contract and all hashes are identical to the expanded form. The compiler derives machine Claims for observable results, atomic Requirements, control fields including location, non-completing outcomes, technical obligations and forbidden shortcuts:
|
|
306
|
+
|
|
307
|
+
<!-- long-task-public-contract-example:start -->
|
|
308
|
+
```yaml
|
|
309
|
+
schema_version: long-task-delivery-v2
|
|
310
|
+
task:
|
|
311
|
+
id: example-task
|
|
312
|
+
title: Example task
|
|
313
|
+
goal: Complete observable delivery goal
|
|
314
|
+
source_paths: [plans/example.md]
|
|
315
|
+
context_refs: [project_context/areas/main.md]
|
|
316
|
+
source_claims:
|
|
317
|
+
- key: observable-requirement
|
|
318
|
+
source_ref: plans/example.md#observable-requirement
|
|
319
|
+
statement: The outcome is observable.
|
|
320
|
+
disposition:
|
|
321
|
+
type: claim
|
|
322
|
+
refs: [observable-outcome.requirement.observable]
|
|
323
|
+
risk:
|
|
324
|
+
facts: {}
|
|
325
|
+
global: {}
|
|
326
|
+
outcomes:
|
|
327
|
+
- key: observable-outcome
|
|
328
|
+
title: Observable outcome
|
|
329
|
+
product:
|
|
330
|
+
observable_result: What a user or system can observe
|
|
331
|
+
owner:
|
|
332
|
+
label: Owning product or module boundary
|
|
333
|
+
context_refs: [project_context/areas/main.md]
|
|
334
|
+
path_globs: ["src/**", "tests/**"]
|
|
335
|
+
requirements:
|
|
336
|
+
- key: observable
|
|
337
|
+
statement: The outcome is observable.
|
|
338
|
+
required_proof_surfaces: [runtime_behavior]
|
|
339
|
+
technical:
|
|
340
|
+
expected_change_paths: ["src/**"]
|
|
341
|
+
bindings:
|
|
342
|
+
- key: observable-carrier
|
|
343
|
+
kind: file
|
|
344
|
+
target: src/observable.ts
|
|
345
|
+
carrier_paths: [src/observable.ts]
|
|
346
|
+
existence: planned
|
|
347
|
+
acceptance:
|
|
348
|
+
checks:
|
|
349
|
+
- key: runtime
|
|
350
|
+
proof_surface: runtime_behavior
|
|
351
|
+
runner:
|
|
352
|
+
type: node_oracle
|
|
353
|
+
target: tests/runtime.mjs
|
|
354
|
+
effect: read_only
|
|
355
|
+
verification_inputs: [tests/runtime.mjs]
|
|
356
|
+
input_paths: [src/observable.ts]
|
|
357
|
+
expected_output_paths: [src/observable.ts]
|
|
358
|
+
positive_assertions:
|
|
359
|
+
- key: observable-ac
|
|
360
|
+
criterion: The declared requirement is observable.
|
|
361
|
+
claims: [result, requirement.observable]
|
|
362
|
+
observation: result
|
|
363
|
+
operator: equals
|
|
364
|
+
expected: true
|
|
365
|
+
counterfactual_controls:
|
|
366
|
+
- key: remove-observable-carrier
|
|
367
|
+
binding_key: observable-carrier
|
|
368
|
+
claims: [result, requirement.observable]
|
|
369
|
+
check_key: runtime
|
|
370
|
+
mutation:
|
|
371
|
+
type: remove_paths
|
|
372
|
+
paths: [src/observable.ts]
|
|
373
|
+
expected_assertion_failures: [observable-ac]
|
|
374
|
+
```
|
|
375
|
+
<!-- long-task-public-contract-example:end -->
|
|
376
|
+
|
|
377
|
+
Authors provide task, Outcome, control and Check keys. The compiler generates `OUT.<outcome-key>` and `CHECK.<outcome-key>.<check-key>` identities. It rejects unknown/duplicate keys, YAML aliases/tags/merges, dependency cycles, unsafe paths, missing Context/source/runner files, missing package scripts, unverifiable Outcomes, and UI Outcomes without browser proof.
|
|
378
|
+
|
|
379
|
+
Global non-goals, constraints and forbidden shortcuts generate `GLOBAL.non_goal.<key>`, `GLOBAL.constraint.<key>` and `GLOBAL.forbidden_shortcut.<key>`. They must be covered by Global Check Assertions using local refs. Non-goals and forbidden shortcuts require negative proof; constraints accept either polarity. Outcome and Global Checks cannot cross Claim scope. Global forbidden paths do not generate Claims because the changed-path boundary enforces them statically.
|
|
380
|
+
|
|
381
|
+
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
|
+
|
|
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`.
|
|
384
|
+
|
|
385
|
+
### One Contract And Source Claims
|
|
386
|
+
|
|
387
|
+
Every complete delivery selected by the user remains one Contract and one Final Gate, even when Outcomes are weakly related. Outcome boundaries exist only for independently decidable, target-verifiable results and never for output length, YAML/file size, frontend/backend layers, module count, parallelism or Agent capacity. New authoring uses inline Outcomes. Existing `outcome_files` remains parser compatibility for physical file organization only and creates no semantic, state or completion boundary.
|
|
388
|
+
|
|
389
|
+
V2 authoring requires at least one real `source_path` and one `source_claim`. During authoring, every Material Source Item in the original Markdown is wrapped without rewriting it:
|
|
390
|
+
|
|
391
|
+
```markdown
|
|
392
|
+
<!-- ty-source-item:start key=save-failure kind=requirement -->
|
|
393
|
+
Saving failure preserves the user's input and shows the reason.
|
|
394
|
+
<!-- ty-source-item:end -->
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Supported kinds are `outcome_result`, `requirement`, `control`, `acceptance`, `technical_obligation`, `non_completing`, `non_goal`, `forbidden_shortcut`, `risk_fact`, `external_confirmation` and `decision`. A risk marker additionally carries its exact pair, for example `<!-- ty-source-item:start key=permission-risk kind=risk_fact fact=permission_boundary_change outcome=observable-outcome -->`. Every declared Source file contains at least one Material Item; background-only references stay outside Source Authority. Marker keys and Source Claim keys must be set-equal and globally unique across all Source files. Nested, overlapping, unclosed, empty or invalid markers fail Compile. Each `source_claim.statement` must match the marked text after only line-ending, surrounding-blank-line and trailing-space normalization.
|
|
398
|
+
|
|
399
|
+
Typed dispositions keep overall results, Requirement/Control/Obligation/Non-completing Claims, one named Acceptance Assertion, Global constraints/non-goals, declared Fact/Affected-Outcome risk pairs, external confirmations and genuine decisions distinct. Risk marker metadata must exactly equal its disposition and declared risk fact, and each Fact/Outcome pair has one Source owner. Source Plan and Runtime use the same ten Fact names: data migration is `data_migration`, a weakly observable critical path is two independent `critical_user_path` and `weak_observability` items, and `multi_repository_change` stays in Source until Compiler rejection. Every other non-decision Source item owns exactly one canonical target of the same kind and normalized text, and no target may have two Source owners. An Outcome Source acceptance maps to one `<outcome>.<check>.<assertion>` whose criterion is text-identical and which proves an independently Source-backed non-Result Claim. A Global Source acceptance maps to `GLOBAL.<check>.<assertion>`, is also criterion-identical, proves no Outcome Claim and includes at least one independently Source-backed Global non-goal, constraint or forbidden-shortcut Claim. `out_of_scope` is retired: an explicit Source non-goal needs covered negative proof, while excluding an in-scope item requires `decision_required`. Ordinary prose and Source Plans remain valid after marker-only enumeration; Compiler coverage is honest about being unable to discover unmarked natural-language requirements.
|
|
400
|
+
|
|
401
|
+
Delivery Set orchestration and top-level Contract splitting within one selected delivery are retired. `ty-context delivery-set ...` returns a fixed non-executing tombstone.
|
|
402
|
+
|
|
403
|
+
Every Contract-authority, Source hash/file-set, selected Context authority structure/file-set/hash, Product/Global semantic or verifier-content change requires `--revise`; ordinary Compile cannot silently refreeze it. Retrieval-only `context.toml` changes do not revise active Authority, while selected ownership, role/dependency and content changes remain protected. After Authority Lock, reductions and Product Claim additions require approval of an exact revision identity. Pure verifier relocation and proven tightening may revise automatically.
|
|
404
|
+
|
|
405
|
+
Every path-bearing field uses one canonical grammar before hashing and matching. Windows separators and one leading `./` normalize to `/`; runner `cwd` alone may be `.`. Internal `.`/`..`, controls, empty segments, absolute/drive/UNC paths, brackets, braces, parentheses/extglob and non-segment `**` are rejected. Pattern matching, subset and overlap/disjoint use the same AST, and unknown relations fail closed.
|
|
406
|
+
|
|
407
|
+
### Deterministic Risk
|
|
408
|
+
|
|
409
|
+
- **L0**: local, reversible, directly testable work stays on the default workflow.
|
|
410
|
+
- **L1 standard**: multiple observable Outcomes or cross-session recovery, with reliable executable checks.
|
|
411
|
+
- **L2 strict**: the same Long-Task workflow and Outcome model, with stronger proof on affected public API/schema, persistent data, migration, security/permission, irreversible, full-population or weak-observability critical-path Outcomes. Multi-repository delivery is unsupported.
|
|
412
|
+
|
|
413
|
+
An explicit user request can raise the level to strict. Explicit `standard` below the computed floor fails with `risk_level_below_required`. Strict negative, counterfactual, population, security, environment and rollback/recovery obligations are compiler-enforced as applicable. Changed paths outside the declared envelope return a `scope_escape` Finding and require the same Goal to review risk/ownership, revise and recompile the Contract.
|
|
414
|
+
|
|
415
|
+
### Evidence And Authority
|
|
416
|
+
|
|
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 produce `structured_json_v2` for all non-browser surfaces. The adapter is part of acceptance, raw-execution, compiled, progress and Receipt identity.
|
|
418
|
+
|
|
419
|
+
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
|
+
|
|
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` requires 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
|
+
|
|
423
|
+
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
|
+
|
|
425
|
+
The workdir `.ty-context/compiled-contract.json` is only a rebuildable cache projection. Previous authority, the immutable initial base, risk floor and Final Gate identity come only from the common-dir snapshot. Commit, verifier migration, clear and abandon share one active-state lock; Final/Verify recheck identity and Stop/close use accepted-identity CAS. Development-period V2 Active Authority, Progress and Receipts are not migrated. Corrupt continuity is recovered explicitly with `abandon --force-corrupt-state`.
|
|
426
|
+
|
|
427
|
+
Final Gate may run only Contract-declared verification commands and never production mutation/deployment/payment/migration execution. Retry defaults to none and is allowed once only for `transient_once` + idempotent + read-only/test-sandbox runners. Runners receive a minimal environment whitelist plus only declared environment requirements. Protected authority/proof inputs reject symlinks and detectable hardlinks. Network isolation remains external. Receipts are audit-only (`reusable_for_acceptance: false`). Human, CI, deployment and product confirmation live only in `external_confirmations`; a machine pass with pending confirmations reports `machine_accepted_external_pending`.
|
|
428
|
+
|
|
429
|
+
## Compatibility And Migration
|
|
430
|
+
|
|
431
|
+
Version 0.6.0 retires the V1 schema/runtime and repo-local Hook. Enable, disable and upgrade remove only exact Tiny Context managed Hook entries. Relocated package-owned absolute commands are recognized only when known managed status and package layout match; similar-name user Hooks remain. Upgrade never imports V1 progress or Receipts into V2 authority. Delivery Set, `composite-campaign` and `composite-long-task` commands are non-executing tombstones.
|
|
432
|
+
|
|
433
|
+
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
|
+
|
|
435
|
+
`/normal-long-task` is also a retirement pointer to `/long-task-workflow`; it creates no checklist, prompt, audit, matrix, verdict or second authority.
|
|
436
|
+
|
|
437
|
+
### Package update modes
|
|
438
|
+
|
|
439
|
+
After updating the package, run `ty-context upgrade`. Use `ty-context upgrade --check` first when you need a read-only plan.
|
|
440
|
+
|
|
441
|
+
Release metadata declares one update mode: `sync-only`, `upgrade-required` or `manual-required`. Upgrade plans report steps as `safe_pending`, `manual_required` or `blocked`. A `sync-only` release may use `sync`; `sync` does not run migrations. An `upgrade-required` release must run upgrade, while `manual-required` includes an explicit operator step.
|
|
442
|
+
|
|
443
|
+
## Development And Verification
|
|
444
|
+
|
|
445
|
+
```powershell
|
|
446
|
+
npm install
|
|
445
447
|
npm run format:check
|
|
446
448
|
npm run typecheck --workspace project-tiny-context-harness
|
|
447
449
|
npm run build --workspace project-tiny-context-harness
|
|
@@ -450,46 +452,46 @@ npm run test:affected
|
|
|
450
452
|
npm run test:long-task:trust
|
|
451
453
|
npm run test:long-task-performance --workspace project-tiny-context-harness
|
|
452
454
|
npm test
|
|
453
|
-
npm run smoke:quickstart
|
|
454
|
-
npm run preview:pack
|
|
455
|
-
npm run launch:check
|
|
456
|
-
node packages/ty-context/dist/cli.js package check-source
|
|
457
|
-
make validate-harness
|
|
455
|
+
npm run smoke:quickstart
|
|
456
|
+
npm run preview:pack
|
|
457
|
+
npm run launch:check
|
|
458
|
+
node packages/ty-context/dist/cli.js package check-source
|
|
459
|
+
make validate-harness
|
|
458
460
|
```
|
|
459
461
|
|
|
460
462
|
`test:affected` is the edit/fix loop. `test:long-task:trust` is the frozen-candidate high-impact boundary gate used by pull-request CI. `npm test` is the complete release regression retained on `main` and publish; do not rerun it after every small repair. Explicit delivery-contract and complete Long-Task gates remain available as package workspace scripts.
|
|
461
463
|
|
|
462
464
|
The modularity gate is `ty-context check-modularity`. Scoped waivers require `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
|
|
463
|
-
|
|
464
|
-
`npm run preview:pack` produces a local preview named `project-tiny-context-harness-0.7.
|
|
465
|
-
|
|
466
|
-
## Community And Further Reading
|
|
467
|
-
|
|
468
|
-
Feedback from real repositories is especially useful. Open an [adoption report](https://github.com/Seven128/project-tiny-context-harness/issues/new?template=adoption_report.yml) with the recovery problem and what remained unclear.
|
|
469
|
-
|
|
470
|
-
Early feedback and starter issues:
|
|
471
|
-
|
|
472
|
-
- Report a [Context recovery gap](https://github.com/Seven128/project-tiny-context-harness/issues/new?template=context_gap.yml) through `context_gap.yml`.
|
|
473
|
-
- Share results in the pinned [adoption reports issue](https://github.com/Seven128/project-tiny-context-harness/issues/4).
|
|
474
|
-
- Pick a starter issue: [demo](https://github.com/Seven128/project-tiny-context-harness/issues/5), [sample walkthrough](https://github.com/Seven128/project-tiny-context-harness/issues/6), [benchmark rerun](https://github.com/Seven128/project-tiny-context-harness/issues/7) or [launch FAQ](https://github.com/Seven128/project-tiny-context-harness/issues/8).
|
|
475
|
-
- Keep claims narrow: recovery evidence is useful; benchmark speedup claims need fresh Minimal Context benchmark runs.
|
|
476
|
-
|
|
477
|
-
Read the [roadmap](docs/roadmap.md), [Benchmarking And Evidence](docs/benchmarking.md), [comparison guide](docs/comparison.md), [adoption guide](docs/adopt-existing-repo.md), [agent surface recipes](docs/agent-surface-recipes.md) and [FAQ](docs/faq.md).
|
|
478
|
-
|
|
479
|
-
For concrete examples, see the [fresh-agent recovery walkthrough](docs/examples/fresh-agent-recovery.md), [Minimal Context sample guide](docs/examples/minimal-context-sample.md) and [browseable sample repository](examples/minimal-context-sample/). The longer argument is [Fresh coding-agent sessions need project memory, not more ceremony](docs/articles/fresh-agent-project-memory.md).
|
|
480
|
-
|
|
481
|
-
## Honest Limits
|
|
482
|
-
|
|
483
|
-
- Tiny Context does not create or restore a platform Goal or physical session.
|
|
484
|
-
- It cannot prove that a user declared every real requirement.
|
|
485
|
-
- Bounded Context keyword search can still miss synonyms or indirect dependencies; it supplements rather than replaces semantic judgment.
|
|
486
|
-
- Harness cannot switch the host-selected model; it only asks for the one post-Authority-Lock user choice.
|
|
487
|
-
- Core long-task execution intentionally provides no parallel mutation runtime.
|
|
488
|
-
- It does not observe platform token counts or model-call counts.
|
|
489
|
-
- Network policy is declared to runners and proxy variables are restricted, but this is not an OS sandbox.
|
|
490
|
-
- Same-user/admin filesystem tampering and Hook bypass are outside its security boundary.
|
|
491
|
-
- Git/PR/CI, deployment and human product confirmation remain external responsibilities.
|
|
492
|
-
|
|
493
|
-
## License
|
|
494
|
-
|
|
495
|
-
MIT
|
|
465
|
+
|
|
466
|
+
`npm run preview:pack` produces a local preview named `project-tiny-context-harness-0.7.1.tgz` under the preview output directory.
|
|
467
|
+
|
|
468
|
+
## Community And Further Reading
|
|
469
|
+
|
|
470
|
+
Feedback from real repositories is especially useful. Open an [adoption report](https://github.com/Seven128/project-tiny-context-harness/issues/new?template=adoption_report.yml) with the recovery problem and what remained unclear.
|
|
471
|
+
|
|
472
|
+
Early feedback and starter issues:
|
|
473
|
+
|
|
474
|
+
- Report a [Context recovery gap](https://github.com/Seven128/project-tiny-context-harness/issues/new?template=context_gap.yml) through `context_gap.yml`.
|
|
475
|
+
- Share results in the pinned [adoption reports issue](https://github.com/Seven128/project-tiny-context-harness/issues/4).
|
|
476
|
+
- Pick a starter issue: [demo](https://github.com/Seven128/project-tiny-context-harness/issues/5), [sample walkthrough](https://github.com/Seven128/project-tiny-context-harness/issues/6), [benchmark rerun](https://github.com/Seven128/project-tiny-context-harness/issues/7) or [launch FAQ](https://github.com/Seven128/project-tiny-context-harness/issues/8).
|
|
477
|
+
- Keep claims narrow: recovery evidence is useful; benchmark speedup claims need fresh Minimal Context benchmark runs.
|
|
478
|
+
|
|
479
|
+
Read the [roadmap](docs/roadmap.md), [Benchmarking And Evidence](docs/benchmarking.md), [comparison guide](docs/comparison.md), [adoption guide](docs/adopt-existing-repo.md), [agent surface recipes](docs/agent-surface-recipes.md) and [FAQ](docs/faq.md).
|
|
480
|
+
|
|
481
|
+
For concrete examples, see the [fresh-agent recovery walkthrough](docs/examples/fresh-agent-recovery.md), [Minimal Context sample guide](docs/examples/minimal-context-sample.md) and [browseable sample repository](examples/minimal-context-sample/). The longer argument is [Fresh coding-agent sessions need project memory, not more ceremony](docs/articles/fresh-agent-project-memory.md).
|
|
482
|
+
|
|
483
|
+
## Honest Limits
|
|
484
|
+
|
|
485
|
+
- Tiny Context does not create or restore a platform Goal or physical session.
|
|
486
|
+
- It cannot prove that a user declared every real requirement.
|
|
487
|
+
- Bounded Context keyword search can still miss synonyms or indirect dependencies; it supplements rather than replaces semantic judgment.
|
|
488
|
+
- Harness cannot switch the host-selected model; it only asks for the one post-Authority-Lock user choice.
|
|
489
|
+
- Core long-task execution intentionally provides no parallel mutation runtime.
|
|
490
|
+
- It does not observe platform token counts or model-call counts.
|
|
491
|
+
- Network policy is declared to runners and proxy variables are restricted, but this is not an OS sandbox.
|
|
492
|
+
- Same-user/admin filesystem tampering and Hook bypass are outside its security boundary.
|
|
493
|
+
- Git/PR/CI, deployment and human product confirmation remain external responsibilities.
|
|
494
|
+
|
|
495
|
+
## License
|
|
496
|
+
|
|
497
|
+
MIT
|