project-tiny-context-harness 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -158,7 +158,7 @@ npm ci
158
158
  npm run smoke:quickstart
159
159
  npm run preview:pack
160
160
  cd /path/to/your/test-repo
161
- npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.8.5.tgz
161
+ npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.8.6.tgz
162
162
  npx --no-install ty-context init --adopt
163
163
  make validate-context
164
164
  ```
@@ -179,19 +179,28 @@ Before deciding `Context Delta`, the Agent combines two low-state routes:
179
179
  2. run one bounded text search over `project_context/**` with a small set of high-signal task terms, including explicit area/module names and relevant API/schema/state/security/verification/deployment language;
180
180
  3. merge the candidates and read only semantically relevant files.
181
181
 
182
- The bounded search supplements rather than replaces Agent semantic judgment. It creates no vector or persistent index, cache, registry, search state or second authority. It can still miss unrelated synonyms or indirect dependencies, so every implementation delivery still performs Architecture Deliberation and final Conformance.
183
-
184
- Ordinary tasks:
185
-
186
- 1. resolve minimum relevant Context through manifest routing plus bounded Context search;
187
- 2. surface one concise, repository-bound Architecture Deliberation;
188
- 3. decide `Context Delta: none|required` and update durable facts before code when required;
189
- 4. use the platform's internal plan;
190
- 5. implement and run project-owned verification;
191
- 6. perform Contract Conformance, including Architecture Conformance on the current candidate;
192
- 7. perform the separate Context drift check and hand off.
193
-
194
- The default workflow has no required plan artifact, matrix, verdict, evidence ledger, persistent retrieval index or second plan. Duration, file count and complexity never auto-enable long-task state.
182
+ The bounded search supplements rather than replaces Agent semantic judgment. It creates no vector or persistent index, cache, registry, search state or second authority. It can still miss unrelated synonyms or indirect dependencies, so every implementation delivery still performs Architecture Deliberation and final Conformance.
183
+
184
+ ### Multi-Area and monorepo repositories
185
+
186
+ Area is a durable product/technical owner and discovery entry; workspace/package/root is a code, build and dependency unit. They need not map one-to-one: one Area may own several workspaces, and shared/infrastructure/governance Areas may own none. When the mapping matters, give each code/workspace root one primary Area owner and record it in Area `Code Entry Points`, architecture Context or a project-owned resolver. Existing manifest fields remain sufficient.
187
+
188
+ The default set plus manifest/search candidates is an expandable working set, not read isolation or a maximum. Read any additional Area/shared Context or code needed for an indirect dependency, but keep read scope separate from the intended product change target. If user language and durable repository ownership still leave materially different sibling product targets ambiguous, ask one concise target question before product edits. Explicitly enumerate intentional cross-Area targets; shared/backend reads do not silently expand edit scope.
189
+
190
+ After implementation, use a repository-owned changed-path/target-scope verifier on exact task-attributable paths when available, or review the final diff against durable owners during Conformance. Tiny Context adds no required workspace/applicability schema, full-graph default, persistent target state, registry, generic path/import/runtime scanner or duplicate Long-Task scope classifier. Single-Area projects keep the same initialization and validation path; an already unambiguous single-target task adds no clarification.
191
+
192
+ Ordinary tasks:
193
+
194
+ 1. resolve minimum relevant Context through manifest routing plus bounded Context search;
195
+ 2. widen the Context working set when shared or indirect dependencies require it, and disambiguate a genuinely unclear sibling product target before product edits;
196
+ 3. surface one concise, repository-bound Architecture Deliberation;
197
+ 4. decide `Context Delta: none|required` and update durable facts before code when required;
198
+ 5. use the platform's internal plan;
199
+ 6. implement and run project-owned verification, including an available changed-path/target-scope check;
200
+ 7. perform Contract Conformance, including Architecture Conformance and final change-scope review on the current candidate;
201
+ 8. perform the separate Context drift check and hand off.
202
+
203
+ The default workflow has no required plan artifact, target declaration, matrix, verdict, evidence ledger, persistent retrieval index or second plan. Duration, file count and complexity never auto-enable long-task state.
195
204
 
196
205
  Plan Validator commands no longer exist; existing plan, matrix or verdict files remain ordinary user files.
197
206
 
@@ -409,7 +418,7 @@ make validate-harness
409
418
 
410
419
  The modularity gate is `ty-context check-modularity`. Scoped waivers require `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
411
420
 
412
- The synchronized local preview tarball is named `project-tiny-context-harness-0.8.5.tgz`.
421
+ The synchronized local preview tarball is named `project-tiny-context-harness-0.8.6.tgz`.
413
422
 
414
423
  ## Community And Further Reading
415
424
 
package/assets/README.md CHANGED
@@ -154,7 +154,7 @@ The smoke packs the local workspace, installs it into a disposable repo and vali
154
154
 
155
155
  ```sh
156
156
  cd /path/to/your/test-repo
157
- npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.8.5.tgz
157
+ npm install -D /path/to/project-tiny-context-harness/tmp/ty-context/source-preview/package/project-tiny-context-harness-0.8.6.tgz
158
158
  npx --no-install ty-context init --adopt
159
159
  make validate-context
160
160
  ```
@@ -181,11 +181,19 @@ project_context/context.toml
181
181
  minimum graph-relevant area/role Context
182
182
  ```
183
183
 
184
- 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.
185
-
186
- `ty-context doctor` reports the deterministic default read footprint, per-file/total soft-budget overages, byte-identical default files and `DESIGN.md` authority status. These are advisory maintenance signals, not a new validation gate or workflow state. If genuine near-universal recovery facts exceed a byte heuristic, preserve the facts and accept the warning; never omit, obscure or misclassify required Context merely to fit the budget.
187
-
188
- 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.
184
+ 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.
185
+
186
+ `ty-context doctor` reports the deterministic default read footprint, per-file/total soft-budget overages, byte-identical default files and `DESIGN.md` authority status. These are advisory maintenance signals, not a new validation gate or workflow state. If genuine near-universal recovery facts exceed a byte heuristic, preserve the facts and accept the warning; never omit, obscure or misclassify required Context merely to fit the budget.
187
+
188
+ 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.
189
+
190
+ ### Multi-Area And Monorepo Repositories
191
+
192
+ Area and workspace are related but different. An Area owns durable product or technical meaning and helps discovery; a workspace/package/root is a code, build and dependency unit. One Area may own several workspaces, and a shared/infrastructure/governance Area may own none. When the mapping matters, give each code/workspace root one primary Area owner and record it in Area `Code Entry Points`, architecture Context or a project-owned resolver—no extra manifest field or one-Area-per-workspace migration is required.
193
+
194
+ The core/default set, manifest candidates and bounded search are the starting working set, not a read ACL or maximum. Read any additional Area, shared backend, cross-client contract, `DESIGN.md`, selected resource or code needed to understand the task. Do not make the complete Context graph the ordinary default, and do not treat reading a sibling Area as permission to edit it.
195
+
196
+ Before product edits, separate read scope from change target. If explicit user language and durable repository ownership still leave several materially different sibling product targets plausible, ask one concise target question rather than choosing the default Area, recent client or a generic keyword match. Intentional cross-Area work names every target; shared/supporting reads remain separate. After implementation, run the repository's own changed-path/target-scope verifier on exact task-attributable paths when available, or review the final diff against durable owners during Conformance. Tiny Context adds no persistent target declaration, workspace registry, applicability matrix, generic import/path/runtime scanner or duplicate Long-Task scope classifier. Single-Area projects keep the same schema and state model; an already unambiguous single-target task adds no clarification.
189
197
 
190
198
  Every engineering handoff reports one Context result:
191
199
 
@@ -197,18 +205,19 @@ Context: no durable fact change
197
205
 
198
206
  ## Default Workflow Contract
199
207
 
200
- Ordinary tasks stay lightweight:
201
-
202
- 1. read core/default Context and collect manifest candidates;
203
- 2. run one bounded Context search over `project_context/**` and read only relevant matches;
204
- 3. surface one concise, repository-bound Architecture Deliberation;
205
- 4. decide `Context Delta: none|required` and update the owning Context first when durable semantics change;
206
- 5. use the platform's internal plan;
207
- 6. implement and run project-owned verification;
208
- 7. perform Contract Conformance, including Architecture Conformance on the current candidate;
209
- 8. perform the separate Context drift check and hand off.
210
-
211
- 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.
208
+ Ordinary tasks stay lightweight:
209
+
210
+ 1. read core/default Context and collect manifest candidates;
211
+ 2. run one bounded Context search over `project_context/**`, read relevant matches and widen when dependencies require more Context;
212
+ 3. in a multi-target repository, resolve the intended change target without turning Area selection into read/edit permission;
213
+ 4. surface one concise, repository-bound Architecture Deliberation;
214
+ 5. decide `Context Delta: none|required` and update the owning Context first when durable semantics change;
215
+ 6. use the platform's internal plan;
216
+ 7. implement and run project-owned verification, including an available changed-path/target-scope check on task-attributable paths;
217
+ 8. perform Contract Conformance, including Architecture Conformance on the current candidate and final change-scope review;
218
+ 9. perform the separate Context drift check and hand off.
219
+
220
+ The default workflow creates no required `plan.md`, target declaration, matrix, verdict, evidence ledger, persistent Context-search index or second execution plan. Task length, file count and complexity never auto-enable long-task state.
212
221
 
213
222
  Plan Validator commands no longer exist; existing plan, matrix or verdict files remain ordinary user files.
214
223
 
@@ -665,7 +674,7 @@ make validate-harness
665
674
 
666
675
  The modularity gate is `ty-context check-modularity`. Scoped waivers require `owner`, `introduced_at`, `reason`, `tracking_issue` and `expiry_condition`.
667
676
 
668
- `npm run preview:pack` produces a local preview named `project-tiny-context-harness-0.8.5.tgz` under the preview output directory.
677
+ `npm run preview:pack` produces a local preview named `project-tiny-context-harness-0.8.6.tgz` under the preview output directory.
669
678
 
670
679
  ## Community And Further Reading
671
680
 
@@ -90,24 +90,33 @@ manifest/trigger 命中的少量 area/role Context
90
90
  3. 合并两路候选,只读取真正相关的 Context;
91
91
  4. 再判断 `Context Delta: none|required`。
92
92
 
93
- 这次搜索只补充语义判断,不会把所有关键词命中都当成 Authority,也不会创建向量/持久索引、缓存、Registry、search state 或第二权威。它仍可能漏掉完全不同的同义词或间接依赖,因此每个实现需求仍要执行 Architecture Deliberation 与收尾 Conformance。
94
-
95
- `ty-context doctor` 会报告确定性的默认 Context 文件/字节规模、单文件与总量软预算超限、字节完全相同的默认文件,以及 `DESIGN.md` 权威状态。这些只是维护提示,不是新验证 Gate 或运行时状态。如果真实的近乎通用恢复事实超过字节启发式预算,应保留事实并接受 warning;绝不能为了满足预算而遗漏、过度压缩或错误分类必需 Context。
96
-
97
- Context 负责耐久的意图和边界,代码负责当前实现,测试/CI/浏览器或运行时证据/人工负责行为与产品验收。
98
-
99
- 普通任务:
100
-
101
- 1. 读取 core/default Context,收集 manifest 候选;
102
- 2. 在 `project_context/**` 做一次 bounded Context search;
103
- 3. 对用户可见地给出一次简洁、仓库事实绑定的 Architecture Deliberation;
104
- 4. 决定 `Context Delta: none|required`,耐久语义改变时先更新 owner Context;
105
- 5. 使用平台内部计划;
106
- 6. 实现并运行项目验证;
107
- 7. 执行 Contract Conformance,其中包含对当前候选快照的 Architecture Conformance;
108
- 8. 单独执行 Context drift check 后交付。
109
-
110
- 默认工作流不要求 `plan.md`、matrix、verdict、evidence ledger、持久检索索引或第二份执行计划。任务时长、文件数和复杂度不会自动激活长程状态。
93
+ 这次搜索只补充语义判断,不会把所有关键词命中都当成 Authority,也不会创建向量/持久索引、缓存、Registry、search state 或第二权威。它仍可能漏掉完全不同的同义词或间接依赖,因此每个实现需求仍要执行 Architecture Deliberation 与收尾 Conformance。
94
+
95
+ `ty-context doctor` 会报告确定性的默认 Context 文件/字节规模、单文件与总量软预算超限、字节完全相同的默认文件,以及 `DESIGN.md` 权威状态。这些只是维护提示,不是新验证 Gate 或运行时状态。如果真实的近乎通用恢复事实超过字节启发式预算,应保留事实并接受 warning;绝不能为了满足预算而遗漏、过度压缩或错误分类必需 Context。
96
+
97
+ Context 负责耐久的意图和边界,代码负责当前实现,测试/CI/浏览器或运行时证据/人工负责行为与产品验收。
98
+
99
+ ### Multi-Area 与 Monorepo
100
+
101
+ Area workspace 有关联,但不是同一种单元。Area 负责耐久的产品/技术语义、ownership 和发现;workspace/package/root 是代码、构建与依赖单元。一个 Area 可以拥有多个 workspace,共享、基础设施或仓库治理 Area 也可以不直接拥有 workspace。映射有长期价值时,每个代码/workspace root 只指定一个 primary Area owner,并写进 Area `Code Entry Points`、architecture Context 或项目自己的 resolver;不需要新增 manifest 字段,也不要求一个 workspace 对应一个 Area。
102
+
103
+ core/default 集合、manifest 候选和 bounded search 是起始 working set,不是读取 ACL 或最大可读集合。任务需要时可以继续读取其他 Area、共享后端、跨客户端 contract、`DESIGN.md`、选定资源或代码。不要把全量 Context 设成普通任务的全局默认,也不要把“读到兄弟 Area”解释为“获得修改它的权限”。
104
+
105
+ 产品编辑前应把 read scope 与 change target 分开。只有当用户明确表达和仓库耐久 ownership 仍无法区分多个实质不同的同级产品目标时,才问一个精确的目标问题;不能默认选择 default Area、最近改过的客户端或通用关键词命中。跨 Area 任务列全目标,共享/supporting 读取保持独立。实现后,如果仓库已有 changed-path / target-scope verifier,就用本任务准确变更路径调用;否则在 Conformance 中按 durable owner 检查最终 diff。Tiny Context 不增加持久 target declaration、workspace Registry、applicability matrix、通用 import/path/runtime scanner 或第二套 Long-Task scope classifier。单 Area 项目没有新增 schema 或状态;已经明确的单目标任务没有新增询问。
106
+
107
+ 普通任务:
108
+
109
+ 1. 读取 core/default Context,收集 manifest 候选;
110
+ 2. `project_context/**` 做一次 bounded Context search,并在依赖需要时继续扩读;
111
+ 3. 多目标仓库先消歧 change target,但不把 Area 变成读取/修改权限;
112
+ 4. 对用户可见地给出一次简洁、仓库事实绑定的 Architecture Deliberation;
113
+ 5. 决定 `Context Delta: none|required`,耐久语义改变时先更新 owner Context;
114
+ 6. 使用平台内部计划;
115
+ 7. 实现并运行项目验证,包括仓库已有的 changed-path / target-scope check;
116
+ 8. 执行 Contract Conformance,其中包含当前候选快照的 Architecture Conformance 和最终 change-scope 审查;
117
+ 9. 单独执行 Context drift check 后交付。
118
+
119
+ 默认工作流不要求 `plan.md`、target declaration、matrix、verdict、evidence ledger、持久检索索引或第二份执行计划。任务时长、文件数和复杂度不会自动激活长程状态。
111
120
 
112
121
  每次交接只报告一个 Context 结果:
113
122
 
@@ -13,14 +13,15 @@ After implementation and project verification, perform one current-candidate `Ar
13
13
  Unless a valid Long-Task binding is active, this prompt-level protocol applies automatically. It guides Agent execution but creates no validator result, Receipt, persisted phase state or machine-completion authority.
14
14
 
15
15
  1. Read `project_context/global.md`, `project_context/architecture.md`, `project_context/context.toml` and the default area root, then collect graph/trigger candidates.
16
- 2. Before deciding `Context Delta`, run one bounded text search over `project_context/**` using a small high-signal set: explicit area/module names plus relevant API/schema/state/security/verification/deployment terms. Merge matches with manifest candidates and read only relevant Context; search supplements rather than replaces semantic judgment.
17
- 3. For every material non-UI product or technical change, complete the task-local semantic obligation below before implementation: inventory all material inputs, atomize every applicable semantic Fact and condition, extend the standard catalog for domain-specific meaning, and bind every Fact to an owner and attributable proof. Missing authority stays decision-required rather than becoming an implementation default.
18
- 4. For UI/product-surface work, confirm information/action/feedback ownership and use `context_surface_contract` when durable responsibility is unclear or changes. For material UI, reconcile affected stable surface/control/target keys as Context-covered, requiring a Context update, task-local, out of scope or decision-required; traverse owning Context and `DESIGN.md`; and open every affected selected `exact-target` or `constraint`. Missing, stale, unreadable or conflicting authority fails closed for the affected claim. Local fixes and explicit non-fidelity prototypes stay lightweight.
19
- 5. Complete `Architecture Deliberation`, then decide exactly one `Context Delta: none|required`. Update owning Context before code for durable product ownership, architecture, API/schema/data, state/recovery, dependency, security, product-surface responsibility or repeatable verification/deployment change. Local fixes preserving durable semantics are `none`.
20
- 6. Use the agent/platform internal plan. Keep `Architecture Context Hit`, `Decision Rationale Hit: existing|required|none` and `Modularity Check: none|required|exception` as internal routing questions, not artifacts or extra deltas.
21
- 7. Implement precisely, run project-owned verification, perform Contract Conformance including `Architecture Conformance`, the non-UI semantic closure and any selected-design closure below, then run the separate Context drift check. Report implementation, verification, architecture conformance, Context status and blockers. For material UI, use the first useful independently runnable production slice as a recommended real-entry feedback point when its expected early-localization value exceeds the run cost; it is not a prerequisite for expanding implementation. Always rerun the affected cold-start journey on the final candidate. Detached routes, specimens and deep links remain supplemental.
22
-
23
- The default workflow never requires a plan artifact, matrix, verdict, evidence ledger or result document. Optional scratch is not Context or proof. Bounded Context search creates no index, cache, state or second authority.
16
+ 2. Before deciding `Context Delta`, run one bounded text search over `project_context/**` using a small high-signal set: explicit area/module names plus relevant API/schema/state/security/verification/deployment terms. Merge matches with manifest candidates, read relevant Context and widen whenever another Area/shared dependency becomes relevant; search supplements rather than replaces semantic judgment.
17
+ 3. In a multi-Area or otherwise multi-target repository, separate the expandable read scope from the intended change target. Area/default/read-policy selection is neither a read ACL nor edit authorization, and Areas need not map one-to-one to workspaces. If user language plus durable repository ownership still leaves materially different sibling product targets ambiguous, ask one concise target question before product edits; enumerate every intentional cross-Area target and keep shared/backend/supporting reads distinct from edit scope.
18
+ 4. For every material non-UI product or technical change, complete the task-local semantic obligation below before implementation: inventory all material inputs, atomize every applicable semantic Fact and condition, extend the standard catalog for domain-specific meaning, and bind every Fact to an owner and attributable proof. Missing authority stays decision-required rather than becoming an implementation default.
19
+ 5. For UI/product-surface work, confirm information/action/feedback ownership and use `context_surface_contract` when durable responsibility is unclear or changes. For material UI, reconcile affected stable surface/control/target keys as Context-covered, requiring a Context update, task-local, out of scope or decision-required; traverse owning Context and `DESIGN.md`; and open every affected selected `exact-target` or `constraint`. Missing, stale, unreadable or conflicting authority fails closed for the affected claim. Local fixes and explicit non-fidelity prototypes stay lightweight.
20
+ 6. Complete `Architecture Deliberation`, then decide exactly one `Context Delta: none|required`. Update owning Context before code for durable product ownership, architecture, API/schema/data, state/recovery, dependency, security, product-surface responsibility or repeatable verification/deployment change. Local fixes preserving durable semantics are `none`.
21
+ 7. Use the agent/platform internal plan. Keep `Architecture Context Hit`, `Decision Rationale Hit: existing|required|none` and `Modularity Check: none|required|exception` as internal routing questions, not artifacts or extra deltas.
22
+ 8. Implement precisely and run project-owned verification. When the repository exposes a changed-path/target-scope check, run it against the intended/supporting targets and exact task-attributable paths; otherwise review the final diff against durable owners during Conformance. Do not attribute unrelated pre-existing dirty paths to the task without provenance. Perform Contract Conformance including `Architecture Conformance`, the non-UI semantic closure and any selected-design closure below, then run the separate Context drift check. Report implementation, verification, architecture conformance, Context status and blockers. For material UI, use the first useful independently runnable production slice as a recommended real-entry feedback point when its expected early-localization value exceeds the run cost; it is not a prerequisite for expanding implementation. Always rerun the affected cold-start journey on the final candidate. Detached routes, specimens and deep links remain supplemental.
23
+
24
+ The default workflow never requires a plan artifact, target declaration, matrix, verdict, evidence ledger or result document. Optional scratch is not Context or proof. Bounded Context search creates no index, cache, state or second authority; it also creates no read isolation. Do not make the full Context graph the ordinary default or add a required workspace/applicability schema, target registry, generic path/import/runtime scanner or duplicate Long-Task scope classifier.
24
25
 
25
26
  ## Shared Non-UI Semantic Completeness Obligation
26
27
 
@@ -6,9 +6,10 @@ This is the restrained architecture context. Keep only facts that help a fresh a
6
6
 
7
7
  - Describe what is inside this project and what external systems, providers or runtime assumptions sit outside it.
8
8
 
9
- ## Component Map
10
-
11
- - List the smallest useful set of components, areas or context units and how they relate.
9
+ ## Component Map
10
+
11
+ - List the smallest useful set of components, areas or context units and how they relate.
12
+ - In a monorepo, record durable Area-to-code/workspace ownership and shared dependency direction where it helps recovery. Do not assume one Area per workspace or turn the map into a read/edit ACL.
12
13
 
13
14
  ## Data / Control Flow
14
15
 
@@ -25,9 +25,10 @@
25
25
 
26
26
  - List constraints that are not obvious from code alone, including product rules, responsive/a11y needs or visual boundaries.
27
27
 
28
- ## Code Entry Points
29
-
30
- - `src/` or the concrete file/function entry points.
28
+ ## Code Entry Points
29
+
30
+ - `src/` or the concrete file/function entry points.
31
+ - In a monorepo, name the code/workspace roots this Area primarily owns and any shared/supporting roots future work commonly needs. Give each root one primary Area owner when the mapping is material; one Area may own several workspaces. This documents ownership and discovery, not read isolation or edit permission.
31
32
 
32
33
  ## Related Role Context
33
34
 
@@ -1,9 +1,15 @@
1
- # Schema v4 Minimal Context graph manifest.
2
- # Keep the default product/domain area for ordinary projects. Role context nodes
3
- # are read-purpose slices owned by an area or, only when cross-domain, by the project root.
4
- # Use read_policy = "default" only for near-universal recovery facts; prefer
5
- # "on-demand" for specialized architecture, contract, deployment or history detail.
6
- # `ty-context doctor` reports the deterministic default read footprint and exact duplicates.
1
+ # Schema v4 Minimal Context graph manifest.
2
+ # Keep the default product/domain area for ordinary projects. Role context nodes
3
+ # are read-purpose slices owned by an area or, only when cross-domain, by the project root.
4
+ # An area is a durable ownership/discovery unit, not a read/edit ACL or a required
5
+ # one-to-one workspace mapping. One area may own several code/workspace roots.
6
+ # Use read_policy = "default" only for near-universal recovery facts; prefer
7
+ # "on-demand" for specialized architecture, contract, deployment or history detail.
8
+ # Default/on-demand selection defines the starting read set, not a maximum:
9
+ # widen to any relevant area/shared Context when task dependencies require it.
10
+ # Monorepos need no additional manifest fields; record useful code/workspace
11
+ # ownership in area or architecture Context and use project-owned scope checks.
12
+ # `ty-context doctor` reports the deterministic default read footprint and exact duplicates.
7
13
  # When migrating deep files under project_context/areas/**, refine obvious
8
14
  # contract/foundation/subdomain/verification/deployment/implementation-index/
9
15
  # decision-rationale/archive files into [[context]] entries instead of keeping
@@ -8,8 +8,9 @@ This role Context records critical repeat-execution paths for the owning area. K
8
8
 
9
9
  ## Verification Paths
10
10
 
11
- - `npm test` or the shortest project-specific test, smoke, CI, probe or validation command.
12
- - Verification paths are reusable execution instances, not independent definitions of the verification target. For capability, metric or acceptance claims, first use the owning module's design Context to decide what claim should be proven, then choose the command or probe.
11
+ - `npm test` or the shortest project-specific test, smoke, CI, probe or validation command.
12
+ - Verification paths are reusable execution instances, not independent definitions of the verification target. For capability, metric or acceptance claims, first use the owning module's design Context to decide what claim should be proven, then choose the command or probe.
13
+ - For a multi-Area repository with a project-owned changed-path/target-scope verifier, record its stable command and inputs here. It validates intended/supporting change scope for task-attributable paths; it does not restrict which Context or code may be read.
13
14
 
14
15
  ## Required Preparation
15
16
 
@@ -17,14 +17,15 @@ When an active `long-task-workflow` binding exists, that Skill owns lifecycle, t
17
17
 
18
18
  ## 默认工作方式
19
19
 
20
- 1. 读取 `project_context/global.md`、`project_context/architecture.md`、`project_context/context.toml`、default area root,并按 triggers/read policy 收集相关 on-demand Context 候选。
21
- 2. 在判断 `Context Delta` 前,用任务中明确的 area/module/API/Schema/state/security/verification/deployment 等少量高信号词,对 `project_context/**` 做一次 bounded text search;把命中的 Context 与 manifest 候选合并,只读取真正相关文件。搜索只补充语义判断,不创建索引、缓存或第二权威。
22
- 3. 确认目标、约束、成功标准、影响域、验证/部署路径和风险。能从代码或 Context 得到的事实不要重复询问。
23
- 4. Context 决定“应该是什么”;代码说明“现在是什么”;测试和运行证据证明行为。冲突是实现漂移、缺失工作或 stale Context,不能由代码静默重定义归属。
24
- 5. 第一处实现编辑前,完成并对用户可见地给出一次简洁、仓库事实绑定的 `Architecture Deliberation`。不输出私有思维链;输出结论及其 Context、模块/路径、symbol/extension point 和验证依据。风险只改变深度,不取消这个环节。
25
- 6. 根据架构考量决定唯一 `Context Delta: none|required`。影响 durable architecture boundary、module ownership、API / Schema / data contract、state / runtime semantics、dependency direction、verification / deployment semantics 或 durable rationale / tradeoff 时为 `required`,先更新 owning Context。不要创建 `plan.md`、Task Contract 文件或 Markdown 映射表。
26
- 7. Agent 内部计划保持 goalnon-goalsownerboundariesimplementation surfacesrisk verification 清晰。默认流程不要求或验证固定 `plan.md`、matrix、verdict evidence ledger。
27
- 8. 实现后先运行 project-owned verification,再在 `Contract Conformance` 中对当前候选快照执行 `Architecture Conformance`,随后单独做 Context drift check;报告实现、验证、架构符合性、Context 状态和 blockers
20
+ 1. 读取 `project_context/global.md`、`project_context/architecture.md`、`project_context/context.toml`、default area root,并按 triggers/read policy 收集相关 on-demand Context 候选。
21
+ 2. 在判断 `Context Delta` 前,用任务中明确的 area/module/API/Schema/state/security/verification/deployment 等少量高信号词,对 `project_context/**` 做一次 bounded text search;把命中的 Context 与 manifest 候选合并,读取真正相关文件,并在代码或语义依赖暴露其他 owner 时继续扩读。搜索只补充语义判断,不创建索引、缓存或第二权威,也不创建读取隔离。
22
+ 3. multi-Area、monorepo 或其他多产品目标仓库中,把“为理解任务而读取什么”和“用户要修改哪个产品目标”分开。Area/default/read policy 既不是读取 ACL,也不是修改授权;Area 与 workspace 不要求一一对应。若用户表达和耐久 ownership 仍无法区分多个实质不同的同级产品目标,在产品编辑前只问一个精确的目标问题;跨 Area 任务显式列全目标,共享/后端读取只进入 supporting scope。
23
+ 4. 确认目标、约束、成功标准、影响域、验证/部署路径和风险。能从代码或 Context 得到的事实不要重复询问。
24
+ 5. Context 决定“应该是什么”;代码说明“现在是什么”;测试和运行证据证明行为。冲突是实现漂移、缺失工作或 stale Context,不能由代码静默重定义归属。
25
+ 6. 第一处实现编辑前,完成并对用户可见地给出一次简洁、仓库事实绑定的 `Architecture Deliberation`。不输出私有思维链;输出结论及其 Context、模块/路径、symbol/extension point 和验证依据。风险只改变深度,不取消这个环节。
26
+ 7. 根据架构考量决定唯一 `Context Delta: none|required`。影响 durable architecture boundarymodule ownershipAPI / Schema / data contractstate / runtime semanticsdependency directionverification / deployment semantics 或 durable rationale / tradeoff 时为 `required`,先更新 owning Context。不要创建 `plan.md`、Task Contract 文件或 Markdown 映射表。
27
+ 8. Agent 内部计划保持 goal、non-goals、owner、boundaries、implementation surfaces、risk verification 清晰。默认流程不要求或验证固定 `plan.md`、matrix、verdict evidence ledger
28
+ 9. 实现后先运行 project-owned verification。仓库已有 changed-path / target-scope checker 时,以本任务准确变更路径和 intended/supporting targets 调用;没有时在 Conformance 中按 durable owner 审查最终 diff,不能把无 provenance 的既有脏改动算进本任务。再在 `Contract Conformance` 中对当前候选快照执行 `Architecture Conformance`,随后单独做 Context drift check;报告实现、验证、架构符合性、Context 状态和 blockers。
28
29
 
29
30
  ## 必经 Architecture Deliberation
30
31
 
@@ -67,7 +68,16 @@ When an active `long-task-workflow` binding exists, that Skill owns lifecycle, t
67
68
 
68
69
  发现问题就返回实现并重跑受影响验证;候选代码或配置再变化,先前 closure 失效。新增或加重技术债默认阻塞交付,除非项目已有显式、收窄、带 owner/reason/tracking/removal condition 的例外。无关 legacy debt 不自动扩张任务范围,但本次触达、依赖或加重的债不能隐藏。
69
70
 
70
- active Long-Task 下不再执行这个默认 closure;同一架构义务由 Contract 中现有 obligations/constraints/forbidden shortcuts、owners/paths/Bindings 和 executable Checks 表达,并只由 Final Gate 对最终快照收口。
71
+ active Long-Task 下不再执行这个默认 closure;同一架构义务由 Contract 中现有 obligations/constraints/forbidden shortcuts、owners/paths/Bindings 和 executable Checks 表达,并只由 Final Gate 对最终快照收口。
72
+
73
+ ## Multi-Area / Monorepo Context 与修改边界
74
+
75
+ - Context 的职责是把 UI/UX Authority、产品、后端、架构、安全、验证/部署等耐久事实存进正确的全局、共享或 Area owner,并让 Agent 低成本找回;它不能保证软约束下的 Agent 一定正确应用,行为仍由项目检查和 review 证明。
76
+ - Workspace/package/repository root 是代码、构建和依赖单元;Area 是产品/技术责任和 Context owner。一个 Area 可以拥有多个 workspace,共享/基础设施/治理 Area 可以没有独立 workspace。ownership 有长期价值时,每个代码/workspace root 只指定一个 primary Area owner,并把映射写进 Area `Code Entry Points`、architecture Context 或项目自己的 ownership resolver;不要机械地为每个 workspace 新建 Area。
77
+ - 默认集合、manifest/trigger 候选和 bounded search 只是起始 working set,不是最大可读集合。开发 B 时可以读取 A/C 或共享后端;只有它们变成用户意图中的修改目标时才进入 target scope。不要把全量 Context 设成所有任务默认,也不要做强制读取闭包。
78
+ - “首页、页面、客户端、前端”等泛词只有在仓库中确实对应多个实质不同的同级产品目标、且用户/路径/owner 事实仍不能消歧时才阻塞。不能仅凭 default Area、最近修改、最近读取或通用关键词选择客户端。已明确的单目标直接继续;跨端目标全部列明。
79
+ - 最终 scope check 区分 intended product targets、allowed supporting changes、forbidden sibling targets 与实际 task-attributable paths。优先复用 verification Context 指向的项目原生 verifier;它可以理解项目自己的 ownership/applicability。Tiny Context 不创建通用 npm/Nx/Bazel/Cargo/Maven workspace mapper、import/path/runtime scanner、持久 target declaration、applicability matrix、Registry 或第二 Authority。
80
+ - 单 Area/非 monorepo 不增加 schema、迁移或状态;只有仓库实际暴露多个仍然歧义的产品目标时才需要询问。显式 Long-Task 继续由既有 expected/supporting/forbidden/unclassified classifier、Authority Revision、`scope_escape` 和 Final Gate 负责,不再运行一套默认 classifier。
71
81
 
72
82
  ## Capability-First Delivery Boundary
73
83
 
@@ -44,6 +44,8 @@ export async function inspectDefaultContextFootprint(projectRootInput) {
44
44
  .sort(([left], [right]) => left.localeCompare(right)),
45
45
  };
46
46
  }
47
+ // This is the advisory startup set only. It does not restrict later reads or
48
+ // turn default Area/read-policy selection into a Context or edit permission.
47
49
  export function selectDefaultContextPaths(manifest) {
48
50
  const selected = new Map();
49
51
  const add = (value, reason) => {
@@ -6,6 +6,12 @@ export function defaultContextManifestTemplate() {
6
6
  "# Schema v4 Minimal Context graph manifest.",
7
7
  "# Keep the default product/domain area for ordinary projects. Role context nodes",
8
8
  "# are read-purpose slices owned by an area or, only when cross-domain, by the project root.",
9
+ "# An area is a durable ownership/discovery unit, not a read/edit ACL or a required",
10
+ "# one-to-one workspace mapping. One area may own several code/workspace roots.",
11
+ "# Default/on-demand selection defines the starting read set, not a maximum;",
12
+ "# widen to any relevant area/shared Context when task dependencies require it.",
13
+ "# Monorepos need no additional manifest fields; record useful code/workspace",
14
+ "# ownership in area or architecture Context and use project-owned scope checks.",
9
15
  "# When migrating deep files under project_context/areas/**, refine obvious",
10
16
  "# contract/foundation/subdomain/verification/deployment/implementation-index/",
11
17
  "# decision-rationale/archive files into [[context]] entries instead of keeping",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-tiny-context-harness",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Minimal project memory and validation harness for AI coding agents.",
5
5
  "license": "MIT",
6
6
  "author": "Seven128",