project-tiny-context-harness 0.8.7 → 0.8.10
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 +146 -118
- package/assets/README.md +276 -246
- package/assets/README.zh-CN.md +169 -137
- package/assets/agents/AGENTS_CORE.md +8 -6
- package/assets/context_templates/architecture.md +10 -7
- package/assets/context_templates/verification.md +7 -5
- package/assets/skills/context_development_engineer/SKILL.md +37 -24
- package/assets/skills/design-resource-authoring/SKILL.md +12 -12
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +57 -48
- package/assets/skills/long-task-workflow/SKILL.md +8 -6
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +1 -1
- package/assets/skills/long-task-workflow/references/contract-authoring.md +13 -11
- package/dist/commands/check-modularity.js +16 -3
- package/dist/commands/design-resource.js +62 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/design-resource-fact-manifest-validation.d.ts +3 -2
- package/dist/lib/design-resource-fact-manifest-validation.js +23 -18
- package/dist/lib/design-resource-fact-universe-catalog.js +18 -8
- package/dist/lib/design-resource-fact-universe-helpers.js +9 -5
- package/dist/lib/design-resource-handoff-bundle.d.ts +31 -0
- package/dist/lib/design-resource-handoff-bundle.js +171 -0
- package/dist/lib/design-resource-handoff-file-validation.d.ts +1 -1
- package/dist/lib/design-resource-handoff-file-validation.js +1 -9
- package/dist/lib/design-resource-handoff-manifest-projection.d.ts +3 -0
- package/dist/lib/design-resource-handoff-manifest-projection.js +37 -0
- package/dist/lib/design-resource-handoff-parser.d.ts +7 -2
- package/dist/lib/design-resource-handoff-parser.js +32 -12
- package/dist/lib/design-resource-handoff-set-integrity.d.ts +8 -0
- package/dist/lib/design-resource-handoff-set-integrity.js +93 -0
- package/dist/lib/design-resource-handoff-shape.d.ts +2 -1
- package/dist/lib/design-resource-handoff-shape.js +62 -0
- package/dist/lib/design-resource-handoff-snapshot.d.ts +6 -0
- package/dist/lib/design-resource-handoff-snapshot.js +21 -0
- package/dist/lib/design-resource-handoff-types.d.ts +23 -1
- package/dist/lib/design-resource-handoff-validation.d.ts +2 -1
- package/dist/lib/design-resource-handoff-validation.js +45 -22
- package/dist/lib/long-task-design-resource-handoff.d.ts +15 -0
- package/dist/lib/long-task-design-resource-handoff.js +63 -173
- package/dist/lib/long-task-design-resource-method-binding.d.ts +8 -0
- package/dist/lib/long-task-design-resource-method-binding.js +135 -0
- package/dist/lib/long-task-source-item-parser.d.ts +8 -0
- package/dist/lib/long-task-source-item-parser.js +29 -107
- package/dist/lib/long-task-source-owned-sections.d.ts +29 -0
- package/dist/lib/long-task-source-owned-sections.js +90 -0
- package/dist/lib/migrations.js +2 -0
- package/dist/lib/modularity-capability-migration.d.ts +2 -0
- package/dist/lib/modularity-capability-migration.js +165 -0
- package/dist/lib/modularity-python.d.ts +7 -0
- package/dist/lib/modularity-python.js +191 -0
- package/dist/lib/modularity.d.ts +12 -5
- package/dist/lib/modularity.js +110 -44
- package/dist/lib/source-files.d.ts +2 -0
- package/dist/lib/source-files.js +21 -0
- package/dist/lib/source-line-scanner.d.ts +3 -0
- package/dist/lib/source-line-scanner.js +42 -0
- package/package.json +84 -84
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This project uses Tiny Context. The Harness maintains durable Context and workflow authority; project tests, CI, runtime evidence and human acceptance prove product quality. Its three capabilities are Minimal Context, the automatically applicable default Workflow Contract and the explicitly selected Single-Goal Long-Task Workflow.
|
|
4
4
|
|
|
5
|
-
## Shared
|
|
5
|
+
## Shared Engineering Quality Obligation
|
|
6
6
|
|
|
7
|
-
Before the first implementation edit, every delivery surfaces one externally observable, repository-bound `Architecture Deliberation`. Depth is risk-proportional, but the checkpoint always names affected owners, the current extension point/source of truth, dependency and state/lifecycle boundaries, the selected design and material alternatives, one plausible future-change challenge, touched technical debt and its disposition, forbidden shortcuts
|
|
7
|
+
Before the first implementation edit, every delivery surfaces one externally observable, repository-bound `Architecture Deliberation`. Depth is risk-proportional, but the checkpoint always names affected owners, the current extension point/source of truth, dependency and state/lifecycle boundaries, the selected design and material alternatives, one plausible future-change challenge, touched technical debt and its disposition, forbidden shortcuts, project-owned checks and triggered engineering-quality attributes or their concrete preservation basis. Correctness/invariants and maintainability/changeability always receive at least a preservation judgment; reliability/resource lifecycle, concurrency/consistency, performance/capacity/cost, security/privacy/safety, compatibility/migration/rollout and operability/observability/testability activate only when the change or an explicit claim makes them material. Exact product/technical predicates remain owned by Semantic Facts and exact selected UI/UX values by selected-design closure. Refresh the checkpoint when scope, ownership, selected design, quality applicability or debt disposition materially changes.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Implementation order, method and feedback cadence remain Goal-owned. Reuse the owning service/facade/adapter and one source of truth, keep the change minimal but complete, preserve explicit failure and resource-lifecycle semantics, and add abstraction only for a stable concept or evidenced change axis. These are guardrails, not a phase, per-edit mandate or proof that code is globally clean.
|
|
10
|
+
|
|
11
|
+
After implementation and project verification, perform one current-candidate `Engineering Quality Conformance` that includes `Architecture Conformance` and every triggered falsifiable invariant. Default work embeds it in Contract Conformance; an active Long-Task embeds it only in Final Gate through existing Source-backed obligations/constraints/forbidden shortcuts, owner/path/Bindings, executable Checks and independent Assertions when functional behavior could pass separately. Never schedule both carriers, and recheck after any candidate or controlling-input change. Final Gate proves only that declared project-check-bound set, not overall code quality. A performance claim additionally requires a workload, metric, baseline or budget, environment, comparator/tolerance and project-owned measurement; static shape is not runtime proof. New/worsened debt, duplicate truth, wrong dependency direction, owner bypass, silent failure, resource-lifecycle defect, scope escape, unsupported quality claim or forbidden shortcut blocks handoff unless a bounded project-owned exception records owner, rationale, tracking and removal condition. This creates no quality artifact, matrix, second Authority, Contract field/aspect/Claim/risk type, Gate, workflow state or generic analyzer.
|
|
10
12
|
|
|
11
13
|
## Default Workflow Contract
|
|
12
14
|
|
|
@@ -17,9 +19,9 @@ Unless a valid Long-Task binding is active, this prompt-level protocol applies a
|
|
|
17
19
|
3. In a monorepo or otherwise multi-target repository, separate the expandable read scope from the task-local intended workspace(s). An optional sparse `project_context/workspaces/<workspace-id>/**` directory maps each represented Context workspace to one code root through existing manifest `root/context`; workspace-local Areas own semantic responsibilities inside it, cross-workspace Areas stay top-level, and code workspaces without durable Context need no empty mirror. Keep the monorepo default Area small and repository-common; workspace-local Context stays `on-demand` unless genuinely near-universal. This structure/default/read policy is neither a read ACL nor edit authorization. Resolve intended workspaces from explicit user/product/path/repository facts; if materially different siblings remain ambiguous, ask one concise target question before product edits. Enumerate intentional multi-workspace targets and supporting/shared scope.
|
|
18
20
|
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
21
|
5. For UI/product-surface work, confirm information/action/feedback ownership and use `context_surface_contract` when durable responsibility is unclear or changes. Root `DESIGN.md` remains the current shared project Design Authority; Context workspace placement does not create independent design systems. 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`.
|
|
22
|
+
6. Complete `Architecture Deliberation`, including applicable-quality routing or a concrete preservation basis, 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
23
|
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 `
|
|
24
|
+
8. Implement precisely under the Goal-owned quality guardrails 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 `Engineering Quality Conformance`, its `Architecture Conformance` subset, the non-UI semantic closure and any selected-design closure below, then run the separate Context drift check. Report implementation, verification, engineering/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
25
|
|
|
24
26
|
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 Context directory for every package-manager workspace, workspace/applicability schema, automatic topology scan, migration, target registry, generic path/import/runtime scanner or duplicate Long-Task scope classifier.
|
|
25
27
|
|
|
@@ -65,7 +67,7 @@ The loaded Skill and its progressive references own Source/Contract authoring, C
|
|
|
65
67
|
|
|
66
68
|
After the first Authority Lock, `execution_model_checkpoint.required: true` is a terminal-turn boundary. Unless the user already stated an explicit task-specific current-model or switch-and-resume strategy, stop before product implementation, edits, builds or tests and ask the user to choose `continue_current_model` or switch models and then resume. Generic continue/resume/finish/continue-goal language does not satisfy it; later revisions do not repeat it and Harness records no model route or checkpoint acknowledgement state.
|
|
67
69
|
|
|
68
|
-
Long-Task Final Gate is the sole `Architecture Conformance` and selected-design closure owner. It source-recompiles and reruns every declared Check on one current snapshot; targeted Progress, prose, historical tests, Receipts, compiled cache or Agent judgment never create acceptance. Exactly fresh `machine_accepted` with no pending External Confirmation is the complete declared-machine terminal; qualified/external-pending results never complete the platform-native Goal.
|
|
70
|
+
Long-Task Final Gate is the sole `Engineering Quality Conformance`, `Architecture Conformance` and selected-design closure owner. It source-recompiles and reruns every declared Check on one current snapshot; targeted Progress, prose, historical tests, Receipts, compiled cache or Agent judgment never create acceptance. It proves the declared falsifiable project-check-bound invariants, not overall code quality. Exactly fresh `machine_accepted` with no pending External Confirmation is the complete declared-machine terminal; qualified/external-pending results never complete the platform-native Goal.
|
|
69
71
|
|
|
70
72
|
The `F = Implementation Freedom Boundary` keeps implementation order, methods, local feedback cadence and optional platform-native one-agent/multi-agent execution Goal-owned within Source/Contract, architecture, safety, forbidden-shortcut and external-action boundaries. Harness creates no development method Gate, per-edit mandate, agent scheduler/delegation state or proof from delegated reports; all proof-bearing output converges into the selected verification workspace.
|
|
71
73
|
|
|
@@ -21,13 +21,16 @@ This is the restrained architecture context. Keep only facts that help a fresh a
|
|
|
21
21
|
- Do not invent rationale or store implementation summaries, PR notes, command output, test result claims, debug history, agent reasoning or reasons inferred only from current code shape.
|
|
22
22
|
- Architecture boundary changes should be captured here before implementation alignment.
|
|
23
23
|
|
|
24
|
-
## Constraints And Tradeoffs
|
|
25
|
-
|
|
26
|
-
- Capture performance, safety,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
## Constraints And Tradeoffs
|
|
25
|
+
|
|
26
|
+
- Capture only durable engineering-quality constraints and tradeoffs that materially shape future work: failure/recovery or resource lifecycle, concurrency/consistency, performance/capacity/cost, security/privacy/safety, compatibility/migration/rollout, integration/deployment/operability or maintainability/changeability.
|
|
27
|
+
- Name the stable owner and extension point, one plausible future-change/load/failure/threat scenario when it explains the constraint, and any bounded debt/exception lifecycle. Do not create a generic quality checklist or duplicate exact product/technical values owned by a contract or other Context.
|
|
28
|
+
|
|
29
|
+
## Verification Implications
|
|
30
|
+
|
|
31
|
+
- List the project-native type/compiler/lint/architecture/contract/behavior/benchmark/probe entry points that can falsify durable boundaries or quality constraints; state only what each path is capable of proving.
|
|
32
|
+
- For a durable performance constraint, preserve workload, metric, environment, baseline or budget and comparator/tolerance ownership here or in the narrower owning Context. Static shape checks are not runtime-performance proof.
|
|
33
|
+
- Do not record one-off results or claim that checks already passed.
|
|
31
34
|
|
|
32
35
|
## Open Risks
|
|
33
36
|
|
|
@@ -6,19 +6,21 @@ This role Context records critical repeat-execution paths for the owning area. K
|
|
|
6
6
|
|
|
7
7
|
- Owning area: `main`.
|
|
8
8
|
|
|
9
|
-
## Verification Paths
|
|
10
|
-
|
|
9
|
+
## Verification Paths
|
|
10
|
+
|
|
11
11
|
- `npm test` or the shortest project-specific test, smoke, CI, probe or validation command.
|
|
12
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
|
+
- Prefer project-native type/compiler/lint/architecture/contract/behavior/benchmark/probe paths. Name what each path can and cannot falsify; a broad pass, Harness heuristic or static shape signal must not be presented as overall code quality or runtime-performance proof.
|
|
13
14
|
- For a multi-workspace repository with a project-owned changed-path/target-scope verifier, record its stable command and inputs here. It validates intended workspace(s) plus allowed supporting changes for task-attributable paths; it does not restrict which Context or code may be read.
|
|
14
15
|
|
|
15
16
|
## Required Preparation
|
|
16
17
|
|
|
17
18
|
- List only durable setup such as services, env files, fixtures, local runtimes or external dependencies needed before rerun.
|
|
18
19
|
|
|
19
|
-
## Expected Signals
|
|
20
|
-
|
|
21
|
-
- Name the stage, health check, status, artifact shape or observable signal that means the path reached the intended point.
|
|
20
|
+
## Expected Signals
|
|
21
|
+
|
|
22
|
+
- Name the stage, health check, status, artifact shape or observable signal that means the path reached the intended point.
|
|
23
|
+
- For repeatable performance/capacity checks, record the stable workload/fixture, metric, environment or environment class, baseline or budget, comparator/tolerance and result location. Keep one-off measured values and pass/fail claims out of Context.
|
|
22
24
|
|
|
23
25
|
## Acceptable Warnings
|
|
24
26
|
|
|
@@ -22,12 +22,12 @@ When an active `long-task-workflow` binding exists, that Skill owns lifecycle, t
|
|
|
22
22
|
3. 在 monorepo 或其他多产品目标仓库中,把“为理解任务而读取什么”和“本任务 intended workspace(s)”分开。可选的 `project_context/workspaces/<workspace-id>/**` 只镜像确有耐久 Context 的实现 workspace;每个已表示 Context workspace 用现有 manifest `root/context` 精确对应一个代码根,内部 Area 负责语义 ownership,跨 workspace Area 留在顶层,未表示的代码 workspace 不建空目录。目录/default/read policy 既不是读取 ACL,也不是修改授权。用用户、产品、路径和仓库事实消歧;仍有多个实质不同的同级目标时,产品编辑前只问一个精确问题。跨 workspace 任务显式列全 intended 与 supporting/shared scope。
|
|
23
23
|
4. 确认目标、约束、成功标准、影响域、验证/部署路径和风险。能从代码或 Context 得到的事实不要重复询问。
|
|
24
24
|
5. Context 决定“应该是什么”;代码说明“现在是什么”;测试和运行证据证明行为。冲突是实现漂移、缺失工作或 stale Context,不能由代码静默重定义归属。
|
|
25
|
-
6. 第一处实现编辑前,完成并对用户可见地给出一次简洁、仓库事实绑定的 `Architecture Deliberation
|
|
25
|
+
6. 第一处实现编辑前,完成并对用户可见地给出一次简洁、仓库事实绑定的 `Architecture Deliberation`,同时给出适用工程质量属性或具体 preservation basis。不输出私有思维链;输出结论及其 Context、模块/路径、symbol/extension point 和验证依据。风险只改变深度,不取消这个环节。
|
|
26
26
|
7. 根据架构考量决定唯一 `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 映射表。
|
|
27
27
|
8. 用 Agent 内部计划保持 goal、non-goals、owner、boundaries、implementation surfaces、risk 和 verification 清晰。默认流程不要求或验证固定 `plan.md`、matrix、verdict 或 evidence ledger。
|
|
28
|
-
9.
|
|
29
|
-
|
|
30
|
-
## 必经 Architecture Deliberation
|
|
28
|
+
9. 实现顺序、方法和反馈节奏仍由 Goal 决定,但遵守下述边界型实现质量纪律。实现后先运行 project-owned verification。仓库已有 changed-path / target-scope checker 时,以本任务准确变更路径和 intended/supporting targets 调用;没有时在 Conformance 中按 durable owner 审查最终 diff,不能把无 provenance 的既有脏改动算进本任务。再在 `Contract Conformance` 中对当前候选快照执行包含 `Architecture Conformance` 的 `Engineering Quality Conformance`,随后单独做 Context drift check;报告实现、验证、工程/架构符合性、Context 状态和 blockers。
|
|
29
|
+
|
|
30
|
+
## 必经 Architecture Deliberation 与适用质量判断
|
|
31
31
|
|
|
32
32
|
每个实现需求都执行一次。small code task 可以得到“保持现有架构”的浅层结论,但必须具体指出当前 owner / extension point、未改变的 durable boundary、验证入口,以及为何没有引入或加重技术债,不能用“无需架构考虑”跳过。
|
|
33
33
|
|
|
@@ -54,21 +54,33 @@ When an active `long-task-workflow` binding exists, that Skill owns lifecycle, t
|
|
|
54
54
|
- 应复用的 extension point,或新抽象为何确有净收益;
|
|
55
55
|
- 哪个 project-owned lint/AST/dependency/contract test 能证明边界。
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
适用质量属性是风险触发的约束与权衡,不是要求全部最大化的 checklist。正确性/invariant 与 maintainability/modularity/changeability 至少给出 preservation 判断;external I/O、async/long-lived resource 或 partial failure 触发 reliability/resource lifecycle;共享可变状态、并行、事务、消息、重试或多 writer 触发 concurrency/consistency;显式性能要求/声称或 hot path、无界 population、I/O、batch/cache/serialization/memory/public abstraction 风险触发 performance/capacity/cost;trust/identity/permission/sensitive data/external input/audit/irreversible effect 触发 security/privacy/safety;公共 API/schema/protocol/storage/config/versioned state 触发 compatibility/migration/rollout;生产 runtime、后台任务或外部集成触发 operability/observability/testability。精确产品/技术谓词继续由 Semantic Facts 拥有,精确选定 UI/UX 值由 selected-design closure 拥有。
|
|
58
|
+
|
|
59
|
+
性能声称必须绑定 workload、metric、baseline 或 budget、environment、comparator/tolerance 和 project-owned benchmark/probe;静态形状检查不能证明运行时性能。没有可归因测量时,只能报告 preservation 或未验证,不能声称改善或满足预算。未触发的质量族给出具体 preservation basis,不创建空矩阵。
|
|
60
|
+
|
|
61
|
+
范围、owner、controlling Context、dependency direction、选定设计、质量适用性或 debt disposition 发生实质变化时,原考量失效,继续实现前先更新。持久结论进入最小 owning Context;实现细节留在代码。不要把“代码更优雅”当作架构要求,也不要让 Harness 变成跨语言通用 dependency analyzer。
|
|
62
|
+
|
|
63
|
+
## Implementation Quality Discipline
|
|
64
|
+
|
|
65
|
+
实现自由保留在当前 Goal,但必须复用 owning service/facade/adapter/extension point 和唯一 source of truth,做最小而完整、语义清晰且在真实边界验证的修改;不得吞掉 failure、发明未授权 default、隐藏 mutable global state 或复制 owner-held rule。只有真实路径需要时才补齐 timeout/cancellation/retry/idempotency/transaction/concurrency/resource-release;只有稳定概念或有证据的变化轴具有正净收益时才引入抽象。函数更短、文件更多或接口更多本身不等于质量。优先使用项目原生 type/compiler/lint/architecture/behavior/benchmark/probe,不让 Harness 启发式或实现自产 expected 代替权威。
|
|
66
|
+
|
|
67
|
+
这些是边界 guardrails,不是新阶段、逐编辑强制动作或“整体代码已干净”的机器结论。
|
|
68
|
+
|
|
69
|
+
## Engineering Quality Conformance
|
|
70
|
+
|
|
71
|
+
默认流程在项目验证之后,把工程质量符合性作为 `Contract Conformance` 的必检子项,只针对当前候选快照检查;`Architecture Conformance` 是其中的架构子集:
|
|
72
|
+
|
|
73
|
+
- 实际改动是否逃逸预期 capability/path;
|
|
74
|
+
- owner、dependency direction、service/facade/adapter 和唯一 source of truth 是否被绕过或复制;
|
|
75
|
+
- API/Schema/data/state/persistence/lifecycle/recovery 是否出现未声明变化;
|
|
76
|
+
- 适用的 failure/resource、concurrency/consistency、security、compatibility/rollout、operability 或 performance 不变量是否有真实处理与可归因的当前候选证据;
|
|
77
|
+
- 是否存在 silent fallback、swallowed failure、resource leak、不可恢复 partial state 或无 workload/environment/measurement 支撑的性能声称;
|
|
78
|
+
- 是否命中 forbidden shortcut,是否运行了声明的 project-owned architecture/modularity checks;
|
|
79
|
+
- 是否新增或加重重复、职责膨胀、脆弱耦合或无依据抽象等技术债。
|
|
68
80
|
|
|
69
81
|
发现问题就返回实现并重跑受影响验证;候选代码或配置再变化,先前 closure 失效。新增或加重技术债默认阻塞交付,除非项目已有显式、收窄、带 owner/reason/tracking/removal condition 的例外。无关 legacy debt 不自动扩张任务范围,但本次触达、依赖或加重的债不能隐藏。
|
|
70
82
|
|
|
71
|
-
active Long-Task 下不再执行这个默认 closure
|
|
83
|
+
active Long-Task 下不再执行这个默认 closure;同一义务由 Contract 中现有 Source-backed obligations/constraints/forbidden shortcuts、owners/paths/Bindings 和 executable Checks 表达。功能行为通过但工程质量不变量仍可能失败时,必须使用独立 Assertion,不能用 `quality == true`、功能 pass 或 prose review 聚合代替。Final Gate 是唯一 `Engineering Quality Conformance`/`Architecture Conformance` carrier,只证明声明、可证伪且绑定项目检查的集合,不证明整体代码质量;不新增 Source aspect、Claim/risk kind、字段、Gate、状态或 Receipt。
|
|
72
84
|
|
|
73
85
|
## 稀疏 Context Workspace / Monorepo 修改边界
|
|
74
86
|
|
|
@@ -147,15 +159,16 @@ Without an active Long-Task, final-current-candidate Contract Conformance confir
|
|
|
147
159
|
|
|
148
160
|
If an active Long-Task applies, do not run the preceding default closure. Express material visual expectations through its existing Requirement, full Control projection, Product `surface_bindings`, Assertion, Check, Stage, Technical Binding and external-confirmation mechanisms. Include the validated residual handoff in real `task.source_paths` and every declared immutable resource in target verification inputs; make target keys/conditions/files equal the handoff. Map covered Source Items into the root conformance Assertion and one independent Assertion per declared verification method. Every method × condition cell carries exact `fact_refs` and canonical `fact_expectations`—subject/variation/property, sensitivity, expected located digest, comparator parameters/tolerance/mask, Oracle and environment—and current typed evidence supplies set-equal per-Fact `fact_results` with actual observation/environment/comparison/verdict; all rows pass and their union closes every required Fact × method obligation. Bind each handoff blocker with the same Source Items and methods. Bind every Control to a required production target and root-entry journey; bind selected exact/constraint targets to typed `design_conformance` actual/comparison evidence. Final Gate is the sole Long-Task carrier. A blocker cannot be dismissed in-band, and scope removal requires revised Source/Contract authority. A design candidate or planned target cannot unlock fidelity implementation: selection must become real Context-reachable Source with one canonical adoption record and an adopted Authority Revision first. Do not introduce a second visual plan, value copy, acceptance document or lifecycle.
|
|
149
161
|
|
|
150
|
-
## Modularity Check
|
|
162
|
+
## Modularity Check
|
|
151
163
|
|
|
152
164
|
新实现、重构、重复逻辑、模块边界或影响面控制需要内部记录 `Modularity Check: none|required|exception`。
|
|
153
165
|
|
|
154
|
-
- 可用 `ty-context check-modularity --file <path> --limit 300` 做计划编辑审计,用 `make validate-code-modularity` 或 `ty-context check-modularity --touched --limit 300 --fail-on-warning` 做交付前硬审计;项目本地 Skill 的 limit 优先。
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
166
|
+
- 可用 `ty-context check-modularity --file <path> --limit 300` 做计划编辑审计,用 `make validate-code-modularity` 或 `ty-context check-modularity --touched --limit 300 --fail-on-warning` 做交付前硬审计;项目本地 Skill 的 limit 优先。
|
|
167
|
+
- 该 capability-aware signal 对所有已纳入格式检查物理行风险;JS/TS family 另做 lexical 单函数语句/分支、导出、状态转换和职责启发式;Python 只做专用 lexical 单函数语句/分支;其他格式(含没有 SFC parser 的 Vue)是 line-only。报告的 `analysis` 说明能力,不支持的指标为 `n/a` 而不是零,且不得参与 risk/regression。
|
|
168
|
+
- 这是 portable risk signal,不是完整跨语言 static analysis、架构证明或运行时性能证据;对应主张优先用 project-native 工具。压缩 JS/TS/Python 代码不能规避其受支持的 lexical 指标。
|
|
169
|
+
- 风险点按 product surface、hook、model、adapter、component、service / facade 或 verification helper 等稳定边界判断,优先复用现有 extension point。
|
|
170
|
+
- 只实施高收益、低风险、语义稳定的抽象;不为一次性代码、不稳定语义或视觉整洁做抽象。
|
|
171
|
+
- `exception` 必须由 `<harnessRoot>/config.yaml` 中 lifecycle-complete waiver 授权,至少包含收窄的 `path`/`category`、`owner`、`introduced_at`、`reason`、`tracking_issue`、`expiry_condition`。交付说明不是机器豁免,已有债务不得继续接收新职责。旧版跨语言 JS 启发式造成且只覆盖现已不支持指标的 waiver,由显式 `ty-context upgrade` 安全清理;普通 `sync` 不做迁移,其他 stale/invalid waiver 继续 fail closed。
|
|
159
172
|
|
|
160
173
|
## 自动化机会
|
|
161
174
|
|
|
@@ -165,8 +178,8 @@ If an active Long-Task applies, do not run the preceding default closure. Expres
|
|
|
165
178
|
|
|
166
179
|
- area/domain/subdomain:产品或包责任;contract:API/schema/event/workflow/interface;foundation:稳定概念;verification/deployment:可重复路径;implementation-index:导航;decision-rationale:会影响未来选择的稳定原因。
|
|
167
180
|
- 模块 Context 只保留 principles、design logic、rejected alternative/tradeoff 和长期约束;不编造 rationale,不复制实现摘要、命令输出、debug 过程、截图、日志、临时 JSON、raw payload、测试报告或 secrets。
|
|
168
|
-
- `Context Delta: none|required` 是唯一长期事实结果;`Architecture Deliberation` 是可见但 task-local
|
|
181
|
+
- `Context Delta: none|required` 是唯一长期事实结果;`Architecture Deliberation`、适用质量判断和 `Engineering Quality Conformance` 是可见但 task-local 的流程检查点/子项,`Architecture Context Hit`、`Decision Rationale Hit` 与 `Modularity Check` 仍只是内部路由问题。
|
|
169
182
|
|
|
170
183
|
## 输出边界
|
|
171
184
|
|
|
172
|
-
不默认创建 `.work_products/**`、tech plan、ADR、implementation doc、review/test/release 文档或 lifecycle phases。`Architecture Deliberation` 与 `
|
|
185
|
+
不默认创建 `.work_products/**`、tech plan、ADR、implementation doc、review/test/release 文档或 lifecycle phases。`Architecture Deliberation` 与 `Engineering Quality Conformance`(含 `Architecture Conformance`)通过工作更新和交付状态可见,不生成新的持久产物,也不增加 Contract/aspect/Claim/risk/Gate/state。用户明确要求独立开发/技术方案时可以临时生成;稳定结论仍提炼回 `project_context/**`。
|
|
@@ -5,7 +5,7 @@ description: Use when the user explicitly asks to generate, author, plan, commis
|
|
|
5
5
|
|
|
6
6
|
# Design Resource Authoring
|
|
7
7
|
|
|
8
|
-
Commission the smallest sufficient set of design resources for the explicitly requested output or development scope from live Open Design capabilities. “Smallest” governs artifact count and surrounding scope, never information granularity. For a formal selected Web/App implementation handoff, first derive the complete material in-scope Expected Fact Universe from requirements, product semantics, adopted design system, target platforms and observable conditions; then require canonical resources to express it and a frozen Inspector to enumerate it. The default identity is one atomic Fact Cell—not a Product Control, page, screenshot, broad dimension row or provider summary—and exact targets additionally require condition-specific full-target layout and pixel facts. This Skill is a thin task-local planner, provider adapter, iteration guide, final proposal reconciler and handoff layer; Open Design owns generation logic and Tiny Context owns neither its prompts nor runtime.
|
|
8
|
+
Commission the smallest sufficient set of design resources for the explicitly requested output or development scope from live Open Design capabilities. “Smallest” governs artifact count and surrounding scope, never information granularity. For a formal selected Web/App implementation handoff, first derive the complete material in-scope Expected Fact Universe from requirements, product semantics, adopted design system, target platforms and observable conditions; then require canonical resources to express it and a frozen Inspector to enumerate it. The default identity is one atomic Fact Cell—not a Product Control, page, screenshot, broad dimension row or provider summary—and exact targets additionally require condition-specific full-target layout and pixel facts. This Skill is a thin task-local planner, provider adapter, iteration guide, final proposal reconciler and handoff layer; Open Design owns generation logic and Tiny Context owns neither its prompts nor runtime.
|
|
9
9
|
|
|
10
10
|
## Hard boundaries
|
|
11
11
|
|
|
@@ -14,10 +14,10 @@ Commission the smallest sufficient set of design resources for the explicitly re
|
|
|
14
14
|
- Proposal reconciliation changes only the initial proposal: never mutate `project_context/**`, `DESIGN.md`, a Source Plan, Delivery Contract, production code or tests as a design-resource side effect.
|
|
15
15
|
- Never make a prototype, wireframe, high-fidelity candidate, design-system slice, provider-native file, variant count or directory layout universally mandatory.
|
|
16
16
|
- Treat the user's explicit output/development scope as the hard ceiling. Include only the surrounding context needed to design that slice.
|
|
17
|
-
- Never require one artifact per control. Reuse selected component sources and group repeated controls by family; commission a dedicated study only for unique or complex uncovered meaning.
|
|
18
|
-
- Do not confuse Product Control granularity with design-fact granularity. An image, text run, icon, component part, smaller visual primitive, layout relation, geometry/style/token/content/state/behavior fact remains independently material when the selected resource expresses it.
|
|
19
|
-
- For a formal selected Web/App handoff, do not let initially generated output define its own obligation universe. Derive that universe before commissioning from scoped subjects, target conditions, subject-local variations and the atomic property catalog. A label such as `all-states`, one default page, representative screenshots, pairwise sampling or an Inspector `complete` Boolean cannot stand in for enumerated identities.
|
|
20
|
-
- Artifact grouping and exact-value ownership remain separate: one HTML/CSS/JS/JSON/SVG source set may carry thousands of atomic facts. Exact values stay in that canonical source; the manifest, residual handoff and downstream Contract preserve typed locators, digests, comparison authority and Fact identities rather than copying CSS into a second value owner.
|
|
17
|
+
- Never require one artifact per control. Reuse selected component sources and group repeated controls by family; commission a dedicated study only for unique or complex uncovered meaning.
|
|
18
|
+
- Do not confuse Product Control granularity with design-fact granularity. An image, text run, icon, component part, smaller visual primitive, layout relation, geometry/style/token/content/state/behavior fact remains independently material when the selected resource expresses it.
|
|
19
|
+
- For a formal selected Web/App handoff, do not let initially generated output define its own obligation universe. Derive that universe before commissioning from scoped subjects, target conditions, subject-local variations and the atomic property catalog. A label such as `all-states`, one default page, representative screenshots, pairwise sampling or an Inspector `complete` Boolean cannot stand in for enumerated identities.
|
|
20
|
+
- Artifact grouping and exact-value ownership remain separate: one HTML/CSS/JS/JSON/SVG source set may carry thousands of atomic facts. Exact values stay in that canonical source; the manifest, residual handoff and downstream Contract preserve typed locators, digests, comparison authority and Fact identities rather than copying CSS into a second value owner.
|
|
21
21
|
- Never infer that a page frame or prototype covers states, responsiveness, accessibility or interaction it does not explicitly specify or demonstrate.
|
|
22
22
|
- Exploration and unselected previews stay schema-free. Only a final selected implementation handoff requires the shared strict Markdown adapter; this is input preparation, not a resource pack or acceptance result.
|
|
23
23
|
- Design resources may express user-visible interaction and presentation, but must not invent or become sole owner of business, data, permission or algorithmic rules.
|
|
@@ -37,15 +37,15 @@ Commission the smallest sufficient set of design resources for the explicitly re
|
|
|
37
37
|
2. **Inventory inputs.** Accept initial proposals, notes, product/technical plans, visual briefs, screenshots, references and existing resources. Preserve each role as exact target, constraint, inspiration, current-implementation evidence or background; report unreadable/unused material.
|
|
38
38
|
3. **Classify visual-style dependency.** Mark the commission `style-bearing` when it materially expresses visual fidelity, brand, typography/color/density, component visual treatment or a production-style prototype. Mark it `non-fidelity` for IA/flow topology, low-fidelity structure, semantics-only behavior/state studies or an explicitly non-fidelity prototype. Mixed work is style-bearing unless split into an independent non-fidelity commission.
|
|
39
39
|
4. **Apply the conditional Design Authority gate.** For style-bearing work, read `DESIGN.md` and its token source. If authority is unconfigured, stop before project/run creation and tell the user to explicitly invoke `$design-system-authoring`; do not invoke it automatically. A combined explicit request authorizes running that Skill first and then resuming this one. Non-fidelity work remains allowed.
|
|
40
|
-
5. **Derive the authoring obligation universe before generation.** For a formal selected Web/App handoff, start from requested Surfaces/flows, product semantics, adopted design-system snapshot and target platforms—not from whatever a first render happens to contain. Enumerate stable subjects and hierarchy for every Surface, region, overlay/system UI, component family and instance, Control, Anatomy Part/slot, primitive, text, icon, media, asset and typed multi-subject relation. Explicitly disposition every standard condition axis—platform/OS/device/form factor, exact viewport, orientation, density, Safe Area, window/fold/display/color modes, locale/language/script/direction/pseudo-localization, content/data stress, text scale, input/assistive technology, motion/transparency/contrast/bold text/button shapes, system UI/IME, permission/capability/connectivity/lifecycle—plus scoped custom axes. For each subject enumerate `variant × state × interaction_phase × presence_phase × instance_case`, including compound precedence, conditional/lazy/virtualized/portal population and exact exclusions. Apply the standard atomic property catalog across geometry, layout/scroll, typography/color/decoration/content/icon/media, interaction/navigation/motion/feedback, responsive, accessibility, assets/system and relations; add inspector-declared custom properties without weakening the standard set. The Expected Fact Universe is the exact applicable `subject × target × condition × variation × property` cell set. Every cell is covered or has an exact source/basis-backed `not_applicable`/`excluded_by_scope`; `decision_required`/`unavailable` remains blocking. Continuous widths, text pressure and animation expose breakpoints/ranges/interpolation/reflow/timeline rules rather than only sampled snapshots. Never truncate, sample, summarize the remainder or let aggregate strings such as `all-states` impersonate atomic identities.
|
|
40
|
+
5. **Derive the authoring obligation universe before generation.** For a formal selected Web/App handoff, start from requested Surfaces/flows, product semantics, adopted design-system snapshot and target platforms—not from whatever a first render happens to contain. Enumerate stable subjects and hierarchy for every Surface, region, overlay/system UI, component family and instance, Control, Anatomy Part/slot, primitive, text, icon, media, asset and typed multi-subject relation. Explicitly disposition every standard condition axis—platform/OS/device/form factor, exact viewport, orientation, density, Safe Area, window/fold/display/color modes, locale/language/script/direction/pseudo-localization, content/data stress, text scale, input/assistive technology, motion/transparency/contrast/bold text/button shapes, system UI/IME, permission/capability/connectivity/lifecycle—plus scoped custom axes. For each subject enumerate `variant × state × interaction_phase × presence_phase × instance_case`, including compound precedence, conditional/lazy/virtualized/portal population and exact exclusions. Apply the standard atomic property catalog across geometry, layout/scroll, typography/color/decoration/content/icon/media, interaction/navigation/motion/feedback, responsive, accessibility, assets/system and relations; add inspector-declared custom properties without weakening the standard set. The Expected Fact Universe is the exact applicable `subject × target × condition × variation × property` cell set. Every cell is covered or has an exact source/basis-backed `not_applicable`/`excluded_by_scope`; `decision_required`/`unavailable` remains blocking. Continuous widths, text pressure and animation expose breakpoints/ranges/interpolation/reflow/timeline rules rather than only sampled snapshots. Never truncate, sample, summarize the remainder or let aggregate strings such as `all-states` impersonate atomic identities.
|
|
41
41
|
6. **Discover live capabilities.** Inspect the current Open Design agent/model, skills, templates, design systems, plugins and export paths. Treat absent/non-enumerable capabilities honestly.
|
|
42
42
|
7. **Choose the minimum sufficient commission.** Give each considered resource `selected`, `optional`, `not-needed`, `unavailable` or `decision-required` with one reason. Ask only when a missing preference materially changes the commission.
|
|
43
|
-
8. **Bind and commission through Open Design.** For style-bearing work, create or verify the Open Design project with the adopted design-system ID and require `get_project.designSystemId` to match. Send the bounded product commission and the derived obligation universe through structured MCP: require the canonical implementation source to encode every applicable atomic value/behavior and require explicit dispositions for non-applicable, excluded or unresolved cells. Use documented fallbacks only when required; if the live provider cannot emit/read a required fact family, preserve that gap as blocking rather than silently narrowing the commission.
|
|
44
|
-
9. **Acquire complete canonical source and its independent Fact manifest.** For Web/App implementation handoff, require Open Design to emit a canonical machine-readable entry, the full locally resolvable dependency set and one `design-resource-observable-fact-manifest-v1` inside that closure—not only a screenshot, preview or prose spec. The manifest freezes the design-system snapshot; exact Inspector identity/version/digest or named external TCB, capabilities, input paths/digests, complete enumeration and dynamic-discovery policy; addressable resource/node/declaration/token/asset/relation/variant/state/interaction/dynamic-population Census; all condition and variation axes/combinations; subject hierarchy; property catalog; Fact Cells/Facts; value and design-system lineage; evidence; Fact × required-method proof obligations; comparator/tolerance/mask, Oracle and render-environment authority; asset bindings; blockers; and non-sampling/non-truncating collection counts/digests. Enumerate and retrieve every selected file without truncation, preserve exact bytes/digests, record one `implementation_web` or `implementation_app` source profile with `acquisition: complete`, and make all local source, token, SVG, font, image, media, worker and asset dependencies resolve inside that frozen set. Non-Web resources use the bounded `reference` profile and are not forced into HTML.
|
|
45
|
-
10. **Inspect, compare and iterate to exact closure.** Run the frozen Inspector over the frozen canonical entry/dependencies. Require every Census item to map to Facts/Fact Cells or a source/basis-backed `non_material` disposition, and require the manifest Fact universe to equal the precommission Expected Fact Universe. Exercise every required verification method with its method-compatible evidence, comparator, Oracle and environment; preserve design-system token/override/conflict lineage and exact asset consumers. Iterate the provider until `Expected Fact Universe = Canonical Resource Facts = Handoff Indexed Facts` can hold. Keep provider execution, artifact readiness and design suitability separate, and keep proposal effects only in the delta buffer while candidates remain unsettled.
|
|
43
|
+
8. **Bind and commission through Open Design.** For style-bearing work, create or verify the Open Design project with the adopted design-system ID and require `get_project.designSystemId` to match. Send the bounded product commission and the derived obligation universe through structured MCP: require the canonical implementation source to encode every applicable atomic value/behavior and require explicit dispositions for non-applicable, excluded or unresolved cells. Use documented fallbacks only when required; if the live provider cannot emit/read a required fact family, preserve that gap as blocking rather than silently narrowing the commission.
|
|
44
|
+
9. **Acquire complete canonical source and its independent Fact manifest.** For Web/App implementation handoff, require Open Design to emit a canonical machine-readable entry, the full locally resolvable dependency set and one `design-resource-observable-fact-manifest-v1` inside that closure—not only a screenshot, preview or prose spec. The manifest freezes the design-system snapshot; exact Inspector identity/version/digest or named external TCB, capabilities, input paths/digests, complete enumeration and dynamic-discovery policy; addressable resource/node/declaration/token/asset/relation/variant/state/interaction/dynamic-population Census; all condition and variation axes/combinations; subject hierarchy; property catalog; Fact Cells/Facts; value and design-system lineage; evidence; Fact × required-method proof obligations; comparator/tolerance/mask, Oracle and render-environment authority; asset bindings; blockers; and non-sampling/non-truncating collection counts/digests. Enumerate and retrieve every selected file without truncation, preserve exact bytes/digests, record one `implementation_web` or `implementation_app` source profile with `acquisition: complete`, and make all local source, token, SVG, font, image, media, worker and asset dependencies resolve inside that frozen set. Non-Web resources use the bounded `reference` profile and are not forced into HTML.
|
|
45
|
+
10. **Inspect, compare and iterate to exact closure.** Run the frozen Inspector over the frozen canonical entry/dependencies. Require every Census item to map to Facts/Fact Cells or a source/basis-backed `non_material` disposition, and require the manifest Fact universe to equal the precommission Expected Fact Universe. Exercise every required verification method with its method-compatible evidence, comparator, Oracle and environment; preserve design-system token/override/conflict lineage and exact asset consumers. Iterate the provider until `Expected Fact Universe = Canonical Resource Facts = Handoff Indexed Facts` can hold. Keep provider execution, artifact readiness and design suitability separate, and keep proposal effects only in the delta buffer while candidates remain unsettled.
|
|
46
46
|
11. **Finalize selection and reconcile once.** After explicit human selection or explicit delegated selection, preserve immutable identity and consolidate accepted, rejected and unresolved effects. Apply only accepted decisions once to a writable initial-proposal file; if it exists only in conversation, return one complete revised proposal. Preserve original intent/provenance and make reruns idempotent. Do not write unresolved or rejected choices as requirements.
|
|
47
|
-
12. **Compile the residual implementation handoff when requested.**
|
|
48
|
-
13. **Return an intent-sized result.** Exploration shows the artifact promptly. An implementation handoff returns the
|
|
47
|
+
12. **Compile the residual implementation handoff when requested.** Keep each canonical per-target `design-resource-observable-fact-manifest-v1` as the sole complete index for Inspector inputs/Census, axes and exclusions, conditions, subjects and variations, properties and lineage, Fact Cells/Facts, evidence/proofs, Oracles/environments, assets and blockers. Do not copy those collections into handoff YAML. For each target, author one small project-native Markdown draft with readable, target-attributed `ty-source-item` facts and exactly one fenced `design-resource-handoff-v1` block whose `representation` is `manifest_backed`. The block contains only residual scope/provenance, resource identities, that one target/profile, resource-fact closure, coverage and proposal binding. Shared meaning is atomized into uniquely keyed target-attributed Source facts without dropping its original predicate or provenance. Freeze the explicit canonical manifest path set and choose an actual UTF-8 byte ceiling before draft generation. Ensure the authorized output parent already exists, then call `ty-context design-resource bundle <draft-dir> <new-output-dir> --manifest <facts.json> [...] --max-handoff-bytes <bytes>`. The command rejects embedded/full-array drafts, multi-target drafts, over-budget descriptors, missing/extra/duplicate targets, manifest path/SHA drift, invalid collection count/identity digests, any normalized preflight failure and any existing final directory; it processes one target at a time in a same-volume temporary directory and publishes the complete target set with one atomic directory rename. Validation is an invariant check on the already compact representation, never a post-hoc splitting pass. On failure only the command-owned temporary directory is removed; drafts and existing/adopted handoffs remain unchanged. Do not author the older embedded V1 representation; it remains readable only for compatibility. Preflight hydrates the omitted collections directly from the declared canonical manifest snapshot and runs the same full semantic validator, so `Expected Fact Universe = Canonical Resource Facts = Handoff Indexed Facts` remains exact without duplicate YAML. File/model/parser/memory pressure never permits pruning, sampling, truncation, coarser Facts, implicit defaults or broader exclusions. If the truthful residual descriptor cannot meet the declared byte ceiling, treat the ceiling as incompatible and fail closed; never split a semantic target. Do not create these files for exploration.
|
|
48
|
+
13. **Return an intent-sized result.** Exploration shows the artifact promptly. An implementation handoff returns the atomically published handoff directory and every target/path mapping, selected immutable resources, stable-key coverage, manifest path/SHA plus collection count/identity-digest conservation, provenance, binding, limitations and successful bundle/preflight result. Include the reconciled initial proposal or its updated path when final selection occurred.
|
|
49
49
|
|
|
50
50
|
## Conditional Design Authority gate
|
|
51
51
|
|
|
@@ -85,4 +85,4 @@ Small requests may complete generation, selection and reconciliation in one turn
|
|
|
85
85
|
|
|
86
86
|
## Completion response
|
|
87
87
|
|
|
88
|
-
Report scope, necessary context/exclusions, style dependency and gate result; selected/omitted/unavailable resources; visible artifacts/typed locators; provider, project/run and design-system binding status; review and selection basis; immutable provenance; implementation source profile, entry/dependency closure and acquisition completeness when applicable; material applicability/coverage and unresolved decisions; proposal reconciliation status/path; and forbidden inferences. For implementation intent, report the
|
|
88
|
+
Report scope, necessary context/exclusions, style dependency and gate result; selected/omitted/unavailable resources; visible artifacts/typed locators; provider, project/run and design-system binding status; review and selection basis; immutable provenance; implementation source profile, entry/dependency closure and acquisition completeness when applicable; material applicability/coverage and unresolved decisions; proposal reconciliation status/path; and forbidden inferences. For implementation intent, report the published directory, every target-to-handoff mapping, canonical manifest path/SHA and collection count/identity-digest conservation, and successful bundle/preflight result; never call a failing, unresolved or incomplete target set ready.
|
|
@@ -16,15 +16,15 @@ For every material in-scope surface/flow/region/component/control condition, rec
|
|
|
16
16
|
|
|
17
17
|
Design resources may show user-visible triggers, transitions, states, feedback and product-rule presentation. Business, data, permission and algorithmic rules remain owned by product/technical Source and must not be invented by visuals.
|
|
18
18
|
|
|
19
|
-
Canonical implementation resources own exact code-expressible layout, visual, content, state, interaction, adaptation, motion, semantic and asset values. The
|
|
20
|
-
|
|
21
|
-
```text
|
|
22
|
-
Expected Fact Universe
|
|
23
|
-
= Canonical Resource Facts enumerated by the frozen Inspector
|
|
24
|
-
= Handoff Indexed Facts
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The Expected Universe is derived before generation from scoped requirements, product semantics, the adopted design system, target environments, stable subjects, condition axes, subject-local variation axes and the atomic property catalog. It is not whatever an initially generated default page happens to expose.
|
|
19
|
+
Canonical implementation resources own exact code-expressible layout, visual, content, state, interaction, adaptation, motion, semantic and asset values. The canonical per-target observable-Fact manifest is the sole complete index of every Fact Cell, Fact and proof. The Markdown handoff is only the residual semantic and binding layer for scope, resources, target profile, resource closure, coverage, Source and proposal identity; preflight hydrates a normalized full handoff from the immutable manifest snapshot. Product Controls remain semantic interaction units and do not cap Fact granularity; addressable images, text, icons, component instances and Anatomy Parts, smaller primitives, relations, geometry/style/token/content/state/behavior facts remain independently queryable. For a formal selected Web/App target, completeness is:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Expected Fact Universe
|
|
23
|
+
= Canonical Resource Facts enumerated by the frozen Inspector
|
|
24
|
+
= Handoff Indexed Facts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The Expected Universe is derived before generation from scoped requirements, product semantics, the adopted design system, target environments, stable subjects, condition axes, subject-local variation axes and the atomic property catalog. It is not whatever an initially generated default page happens to expose.
|
|
28
28
|
|
|
29
29
|
## Final proposal reconciliation
|
|
30
30
|
|
|
@@ -72,52 +72,61 @@ Return scope/intent, visible candidates, resource dispositions, obvious limitati
|
|
|
72
72
|
|
|
73
73
|
### Implementation handoff
|
|
74
74
|
|
|
75
|
-
After final selection for implementation, add one project-native Markdown Source at
|
|
75
|
+
After final selection for implementation, add one or more project-native Markdown Source files at authorized repository paths. They are ordinary Source, not a pack or Authority. Frozen canonical resources carry addressable implementation facts, while the residual handoff files close scope, applicability, uncovered meaning, product/technical semantics, blockers and downstream bindings. Each physical file contains readable `ty-source-item:start/end` facts plus exactly one:
|
|
76
76
|
|
|
77
77
|
````markdown
|
|
78
78
|
```yaml design-resource-handoff-v1
|
|
79
|
-
|
|
79
|
+
schema_version: design-resource-handoff-v1
|
|
80
|
+
representation: manifest_backed
|
|
81
|
+
# residual scope/resource/target/closure/coverage/proposal fields only
|
|
80
82
|
```
|
|
81
83
|
````
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
- exactly one `
|
|
107
|
-
-
|
|
108
|
-
- for every
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
85
|
+
Freeze the explicit canonical manifest path set and its target/scope identities, file SHA-256 values, and exact per-collection counts/identity digests before generating Markdown. Choose a truthful UTF-8 ceiling, then author one small draft per target. Each block keeps the shipped `design-resource-handoff-v1` marker and adds `representation: manifest_backed`; it does not repeat the manifest-owned arrays. Keep shared meaning as uniquely keyed, target-attributed Source facts without weakening the original predicate or provenance. Ensure the authorized output parent already exists, then run one bundle command over the complete draft and manifest sets. It rejects any embedded/full-array or multi-target draft, over-budget descriptor, missing/extra/duplicate target, stale manifest identity, invalid generation digest or normalized preflight failure; processes targets sequentially in a same-volume command-owned temporary directory; and atomically renames the complete set to a previously nonexistent final directory. Failure removes only that temporary directory. Drafts and existing/adopted handoffs are never overwritten, split or rewritten. The byte check is a guard on the already compact representation, not a post-hoc split. If truthful residual Source/scope/resource/closure/coverage/proposal data cannot meet the selected ceiling, the ceiling is incompatible and publication fails closed; a semantic target is never divided. File size, parser capacity, model output or memory pressure never permits sampling, truncation, Fact coarsening, implicit defaults or broader N/A/exclusions.
|
|
86
|
+
|
|
87
|
+
Each strict YAML block includes only:
|
|
88
|
+
|
|
89
|
+
- output/development scope, necessary context and exclusions;
|
|
90
|
+
- stable resource and exactly one target identity;
|
|
91
|
+
- selected exact-target/constraint/supporting classification; candidates and inspiration do not enter covered implementation rows;
|
|
92
|
+
- provider version, project/run, capability/template, agent/model and live design-system binding;
|
|
93
|
+
- each repository-local immutable resource path, media type and exact SHA-256;
|
|
94
|
+
- for implementation Web/App targets, a canonical entry, complete locally resolvable dependency set, one canonical `design-resource-observable-fact-manifest-v1` inside that set and `acquisition: complete`; non-Web resources use `reference` and are not forced into HTML;
|
|
95
|
+
- editable upstream owner, locator and update/export method, or an explicit manual/external-update boundary when unavailable;
|
|
96
|
+
- exactly one `resource_fact_closure` entry per resource, roll-up coverage with exact manifest-owned references, proposal reconciliation identity and readable target-attributed Source Items.
|
|
97
|
+
|
|
98
|
+
The referenced canonical manifest plus this residual block normalize to the complete handoff and therefore additionally include:
|
|
99
|
+
|
|
100
|
+
- a frozen Inspector identity/version/digest or named external TCB; exact capabilities, canonical entry, all input resource paths/digests, `complete_enumeration`, fully enumerated dynamic discovery and an addressable Census of every material resource/node/declaration/token/asset/relation/custom property/variant/state/interaction phase/dynamic population item;
|
|
101
|
+
- each Census row bound to exact Fact/Fact Cell sets or a source/basis-backed `non_material` rationale. An Inspector `complete` Boolean, resource count or provider statement does not replace the Census;
|
|
102
|
+
- all 33 standard target-condition axes—platform, OS, device profile, form factor, exact viewport width/height, orientation, density/pixel ratio, Safe Area insets, window/fold/display/color modes, locale/language/script/direction/pseudo-localization, content/data stress, text scale/multiplier, input/assistive technology, motion/transparency/contrast/bold text/button shapes, system UI/IME, permission/capability/connectivity/lifecycle—plus scoped custom axes. Each has an explicit applicable/not-applicable disposition and stable values; reuse of one viewport/density/Safe-Area/text-scale key with conflicting geometry is invalid;
|
|
103
|
+
- the complete target-condition Cartesian universe, with every applicable combination present and every omitted combination carrying an exact source/basis-backed exclusion. Continuous viewport/text-pressure behavior additionally exposes exact breakpoints, ranges, interpolation and reflow rules;
|
|
104
|
+
- stable subjects for every in-scope Surface, flow, region, overlay/system UI, component family and instance, Control, Anatomy Part/slot, primitive, text, icon, media, asset and typed multi-subject relation; exact parent/instance/family/override/slot/portal/presence/population/Census lineage prevents a family or one rendered instance from hiding internal or repeated subjects;
|
|
105
|
+
- for every subject, explicit `variant`, `state`, `interaction_phase`, `presence_phase` and `instance_case` axis dispositions plus the complete compound variation universe and exact exclusions. Labels such as `all-21-state-catalog` cannot impersonate 21 atomic states;
|
|
106
|
+
- the complete standard atomic property catalog plus justified inspector-declared custom properties. Properties carry stable key, family, UI/UX dimension, typed value kind, required verification methods, Inspector capabilities and Census lineage. The eight dimensions—`surface_flow`, `visual_content`, `component_control`, `state_interaction`, `motion`, `adaptation_input`, `accessibility`, `assets`—remain reporting roll-ups, not the Fact ceiling;
|
|
107
|
+
- one explicit Fact Cell for every applicable `subject × target × condition × variation × property` identity. Every cell is `covered`, source/basis-backed `not_applicable`/`excluded_by_scope`, or blocking `decision_required`/`unavailable`; sampling, pairwise coverage, summaries and implicit defaults are forbidden;
|
|
108
|
+
- one atomic Fact for every covered cell, carrying exactly one subject/target/condition/variation/property, dimension, `subject|full_target` observation scope, `plain|protected` sensitivity, typed value kind, canonical value located digest, same-target/condition evidence, Source-item lineage and effective design-system lineage. Exact token/alias/platform/mode/state/instance overrides and resolved conflicts remain traceable;
|
|
109
|
+
- typed, locally resolvable value/evidence locators for HTML/CSS/JS/JSON/Markdown/SVG or bounded binary whole-resource identity. Critical values cannot live only in a bitmap, preview or prose. Exact values stay in canonical resources; the handoff preserves locator/digest identity rather than copying CSS;
|
|
110
|
+
- separate `proof_obligations` for every Fact × property-required verification method. Each names method-compatible evidence, comparator, exact/tolerance mode, canonical parameter/tolerance and optional narrow mask located digests, one frozen executable or named external Oracle with method capability, and one frozen render environment. A Fact needing token and pixel proof keeps both;
|
|
111
|
+
- exact asset bindings to asset subjects, immutable resources, target/condition Facts and consumer subjects, including density/platform/theme/mode/locale variants, crop/focal/mask/placeholder/error/decode/fallback behavior;
|
|
112
|
+
- generation metadata proving `complete_explicit`, `sampling: forbidden`, `truncation: forbidden`, contiguous chunk indexes, and exact count plus identity digest for every Inspector input/Census, axis, condition, subject, variation, property, lineage, Fact Cell/Fact, evidence/proof, Oracle/environment, asset and blocker collection;
|
|
113
|
+
- hydration from the declared manifest bytes for every manifest-owned collection, so the residual handoff cannot restate or certify a narrower universe;
|
|
114
|
+
- roll-up coverage whose subject/target/condition/variation/property/Fact Cell/Fact/proof/evidence/Source/method sets exactly equal their indexed unions; every Fact Cell, Fact and proof appears exactly once in coverage;
|
|
115
|
+
- for every `exact_target` condition, one `full_target` `layout_geometry` fact and one `full_target` `visual_pixel` fact backed by exact-target evidence; if complete visible fidelity cannot be extracted/compared, keep the resource a `constraint` or unresolved;
|
|
116
|
+
- source/Inspector-backed rationales for every non-applicable/excluded cell; unresolved rows remain visible and make preflight fail;
|
|
117
|
+
- target-local acceptance blockers with exact target/subject/dimension/Source-item/verification-method lineage and a non-empty `required_capabilities` set; use the narrowest truthful capability such as physical device, sensor, camera, orientation, haptic, screen reader, pixel-density, safe-area, input or production runtime rather than weakening it to an available proxy;
|
|
118
|
+
- selection basis, proposal reconciliation path/status and known limitations;
|
|
119
|
+
- outer review and separate provider/artifact/design qualifiers.
|
|
120
|
+
|
|
121
|
+
Unknown fields fail closed. Every resource must be inspected; a material resource cannot be hidden as `supporting_only`, and unsupported/unreadable extraction remains blocking inside the named Inspector/Oracle TCB. All `decision_required`, `unavailable` and acceptance blockers prevent a `ready` result. A static frame may support only visible layout/visual/component Facts for its shown condition; pixel evidence cannot cover unseen interaction, motion, adaptation/input or accessibility. Protected Facts retain canonical-source ownership while downstream observations use attributable digest-only or redacted representations and never persist raw sensitive values. Publish the complete set:
|
|
115
122
|
|
|
116
123
|
```text
|
|
117
|
-
ty-context design-resource
|
|
124
|
+
ty-context design-resource bundle <draft-dir> <new-output-dir> \
|
|
125
|
+
--manifest <facts.json> [--manifest <facts.json> ...] \
|
|
126
|
+
--max-handoff-bytes <bytes>
|
|
118
127
|
```
|
|
119
128
|
|
|
120
|
-
Do not call the handoff ready until
|
|
129
|
+
`ty-context design-resource preflight <handoff.md>` remains available for one-file inspection and for older embedded V1 read compatibility, but new DSA authoring uses `bundle`. Do not call the handoff set ready until bundle publication succeeds. Passing proves acquisition, integrity and exact declared-universe closure relative to the frozen Inspector/Oracle TCB; it does not prove production implementation conformance. Exploration, candidates and unselected previews still require no file, schema, hash sequence or validator. There is no fixed directory, one-file-per-Control or one-file-per-Fact requirement.
|
|
121
130
|
|
|
122
131
|
## Recommended downstream routing
|
|
123
132
|
|
|
@@ -127,7 +136,7 @@ initial proposal
|
|
|
127
136
|
-> selected immutable resources
|
|
128
137
|
+ complete canonical implementation resources
|
|
129
138
|
+ reconciled initial proposal
|
|
130
|
-
-> validated
|
|
139
|
+
-> validated manifest-backed design-resource-handoff-v1 target file(s)
|
|
131
140
|
-> long-task-workflow (explicit long delivery)
|
|
132
141
|
OR current native Goal + default Workflow Contract (non-long delivery)
|
|
133
142
|
```
|
|
@@ -136,11 +145,11 @@ initial proposal
|
|
|
136
145
|
|
|
137
146
|
### Default Workflow consumption
|
|
138
147
|
|
|
139
|
-
The consuming Goal brings the revised proposal, selected resources and residual handoff as ordinary Source. It reruns shared preflight before UI Authority Closure, opens affected exact/constraint resources before deciding, classifies coverage, decides `Context Delta`, and makes every adopted decision-relevant target Context-reachable through existing owners. It keeps one ephemeral exact accounting of every Fact Cell, Fact and Fact × method obligation; routes each through the production owner and real-entry check; compares the current candidate with the frozen expected locator/digest using the declared comparator/tolerance/mask, Oracle and environment; and retains an attributable per-Fact actual observation and pass/fail verdict. Any unread, unsupported, unmapped, unimplemented, unverified, stale, failed or indistinguishable applicable Fact blocks the complete claim. A later update creates a new immutable version rather than overwriting the adopted baseline.
|
|
148
|
+
The consuming Goal brings the revised proposal, selected resources and every residual handoff file as ordinary Source. It reruns shared preflight per file, proves the exact target set before UI Authority Closure, opens affected exact/constraint resources before deciding, classifies coverage, decides `Context Delta`, and makes every adopted decision-relevant target Context-reachable through existing owners. It keeps one ephemeral exact accounting of every Fact Cell, Fact and Fact × method obligation; routes each through the production owner and real-entry check; compares the current candidate with the frozen expected locator/digest using the declared comparator/tolerance/mask, Oracle and environment; and retains an attributable per-Fact actual observation and pass/fail verdict. Any unread, unsupported, unmapped, unimplemented, unverified, stale, failed or indistinguishable applicable Fact blocks the complete claim. A later update creates a new immutable version rather than overwriting the adopted baseline.
|
|
140
149
|
|
|
141
150
|
### Long-Task consumption
|
|
142
151
|
|
|
143
|
-
The same revised proposal, selected resources and validated residual handoff enter `long-task-workflow`'s Source-bound Contract Draft loop immediately.
|
|
152
|
+
The same revised proposal, selected resources and all validated residual handoff files enter `long-task-workflow`'s Source-bound Contract Draft loop immediately. Every marked handoff is in `task.source_paths`; each Contract design target's frozen `source_paths` and Check `verification_inputs` equal its owning handoff plus every declared resource path and condition. Preflight hydrates one target at a time from its canonical manifest; Compile rejects missing, extra or duplicate targets and conflicting repeated residual shared rows while retaining only compact cross-file indexes. This adapter seam preserves the existing Contract, Authority, Outcome, deterministic fail-closed diagnostic precedence and Final Gate. Covered Source Items map through `source_claims` to the root conformance Assertion. Every verification method maps to an independently failing Assertion carrying its relevant Source Claims; each method × condition evidence cell carries exact handoff `fact_refs` plus canonical `fact_expectations` for subject/variation/property, sensitivity, expected located digest, comparator/parameters/tolerance/mask, Oracle and environment. Their exact union equals the target Fact set and all property-required Fact × method obligations. Current typed `design_method` evidence repeats the exact Fact set and supplies one `fact_results` row per Fact: attributable actual observation and actual environment, comparison record, exact authority identities and pass/fail verdict. Protected observations are digest-only/redacted according to the frozen sensitivity policy. Missing, extra, duplicate, stale, failed, authority-drifted or reused/indistinguishable rows fail the Assertion. Every blocker preserves its Source-item/method/required-capability lineage into a machine Claim proved on the exact capability-qualified target or a target-blocking External Confirmation. Authority Lock, Authority Revision and Final Gate remain the sole lifecycle and Final Gate source-recompiles/reruns the whole current snapshot. This Skill creates no Contract Draft, Outcome, Receipt, Check result or Gate.
|
|
144
153
|
|
|
145
154
|
## Forbidden inferences
|
|
146
155
|
|