project-tiny-context-harness 0.8.16 → 0.8.17
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 +31 -16
- package/assets/README.md +31 -16
- package/assets/README.zh-CN.md +29 -14
- package/assets/context_templates/screen-contract.md +16 -0
- package/assets/skills/context_development_engineer/SKILL.md +16 -30
- package/assets/skills/context_development_engineer/references/engineering-design-reasoning.md +93 -0
- package/assets/skills/context_surface_contract/SKILL.md +13 -2
- package/assets/skills/context_uiux_design/SKILL.md +7 -3
- package/assets/skills/context_uiux_design/references/task-uiux-analysis.md +82 -0
- package/assets/skills/design-resource-authoring/SKILL.md +14 -8
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +18 -6
- package/assets/skills/design-resource-authoring/references/formal-selected-web-app-handoff.md +26 -8
- package/assets/skills/design-resource-authoring/references/implementation-feasibility.md +111 -0
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +45 -7
- package/assets/skills/design-resource-authoring/references/recovery-and-writeback.md +7 -1
- package/assets/skills/design-resource-authoring/references/resource-selection.md +115 -3
- package/dist/commands/design-resource.js +9 -2
- package/dist/index.d.ts +1 -1
- package/dist/lib/design-resource-handoff-bundle.js +5 -0
- package/dist/lib/design-resource-handoff-input-types.d.ts +1 -1
- package/dist/lib/design-resource-handoff-manifest-projection.js +1 -0
- package/dist/lib/design-resource-handoff-set-integrity.js +1 -0
- package/dist/lib/design-resource-handoff-shape.js +6 -2
- package/dist/lib/design-resource-handoff-types.d.ts +5 -0
- package/dist/lib/design-resource-handoff-validation.js +12 -0
- package/dist/lib/design-resource-implementation-feasibility-model.d.ts +35 -0
- package/dist/lib/design-resource-implementation-feasibility-model.js +62 -0
- package/dist/lib/design-resource-implementation-feasibility-shape-sections.d.ts +43 -0
- package/dist/lib/design-resource-implementation-feasibility-shape-sections.js +142 -0
- package/dist/lib/design-resource-implementation-feasibility-shape.d.ts +4 -0
- package/dist/lib/design-resource-implementation-feasibility-shape.js +154 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision-projection.d.ts +24 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision-projection.js +106 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision.d.ts +21 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision.js +75 -0
- package/dist/lib/design-resource-implementation-feasibility-types.d.ts +135 -0
- package/dist/lib/design-resource-implementation-feasibility-types.js +37 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-cells.d.ts +5 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-cells.js +125 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-document.d.ts +4 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-document.js +167 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-facts.d.ts +3 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-facts.js +76 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-realizations.d.ts +8 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-realizations.js +76 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-support.d.ts +10 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-support.js +75 -0
- package/dist/lib/design-resource-implementation-feasibility-validation.d.ts +3 -0
- package/dist/lib/design-resource-implementation-feasibility-validation.js +138 -0
- package/dist/lib/design-resource-symbolic-fact-shape.js +3 -1
- package/dist/lib/design-resource-symbolic-fact-types.d.ts +5 -0
- package/dist/lib/design-resource-symbolic-fact-validation.js +13 -0
- package/dist/lib/long-task-activation-validation.js +77 -7
- package/dist/lib/long-task-check-runner.js +3 -296
- package/dist/lib/long-task-command-process.d.ts +9 -0
- package/dist/lib/long-task-command-process.js +175 -0
- package/dist/lib/long-task-delivery-validation.d.ts +5 -2
- package/dist/lib/long-task-delivery-validation.js +4 -4
- package/dist/lib/long-task-design-feasibility-binding-owners.d.ts +6 -0
- package/dist/lib/long-task-design-feasibility-binding-owners.js +52 -0
- package/dist/lib/long-task-design-feasibility-binding.d.ts +13 -0
- package/dist/lib/long-task-design-feasibility-binding.js +114 -0
- package/dist/lib/long-task-design-feasibility-source-closure.d.ts +11 -0
- package/dist/lib/long-task-design-feasibility-source-closure.js +78 -0
- package/dist/lib/long-task-design-resource-handoff.d.ts +3 -3
- package/dist/lib/long-task-design-resource-handoff.js +39 -3
- package/dist/lib/long-task-design-resource-method-binding.js +8 -2
- package/dist/lib/long-task-freshness.js +1 -1
- package/dist/lib/long-task-process-table.d.ts +12 -0
- package/dist/lib/long-task-process-table.js +119 -0
- package/dist/lib/long-task-process-tree.d.ts +9 -0
- package/dist/lib/long-task-process-tree.js +138 -0
- package/dist/lib/long-task-protected-files.d.ts +1 -1
- package/dist/lib/long-task-protected-files.js +1 -1
- package/dist/lib/long-task-ui-surface-policy.d.ts +2 -1
- package/dist/lib/long-task-ui-surface-policy.js +7 -4
- package/dist/lib/long-task-ui-surface-validation.d.ts +3 -1
- package/dist/lib/long-task-ui-surface-validation.js +2 -2
- package/dist/lib/repository-path-safety.d.ts +2 -0
- package/dist/lib/repository-path-safety.js +36 -0
- package/dist/public-types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@ Load this reference only for a material generation/revision loop which needs com
|
|
|
6
6
|
|
|
7
7
|
A simple scoped preview creates zero recovery files and persisted recovery bytes, adds no user pause or Provider generation beyond the one requested commission, runs no formal handoff/preflight, performs no Proposal writeback and opens no helper write transaction. Its ordinary requested preview is the commission itself; recovery adds and reports zero tool actions. Keep its temporary reasoning in the current turn.
|
|
8
8
|
|
|
9
|
+
Ordinary conversational review and selection remains legal outside this deterministic path. It creates no approval record or persistent selection state and must be reconfirmed if lost before authorized materialization. Deterministic cross-interruption selection uses only the existing raw-digest-bound marked Source, `ty-dra-authority-v1`, selected-resource binding and conditional checkpoint below; do not invent `review_set_id`, approval status or another checkpoint kind.
|
|
10
|
+
|
|
11
|
+
Without the complete bindings below, an ordinary loop may report only conservative impact analysis from readable Source, identify unverified scope and regenerate conservatively within the hard ceiling or return `decision-required`. It cannot claim that only identified resources are affected. When this recoverable path has a complete current catalog, change and preservation claims remain bounded to its exact Requirements-to-Resource, Resource-to-Requirements, explicitly unchanged, blast-radius and inactive-leakage universes.
|
|
12
|
+
|
|
9
13
|
Use a recovery checkpoint only when interruption would otherwise lose material accepted/rejected/unresolved semantics, immutable Provider identity or a pending CAS writeback. It is versioned, ignored, task-local, non-authoritative and deletable. It is not Source, Context, a Contract, Authority, Evidence, Receipt, Gate, Provider registry, scheduler, acceptance state or completion conclusion. There is no global session registry, event log, heartbeat, polling loop or state-machine service.
|
|
10
14
|
|
|
11
15
|
For deterministic classification, apply four fail-closed invariants before details: validate every semantic key independently; retain every valid accepted/rejected/unresolved decision and its authority row even when a later patch, audit or owner fails; reject deterministic checkpoint input whose claimed Source authority is invalid; and report a requested or pending unsafe reconciliation/writeback as blocked rather than as no action. Provider/resource selection never fills a missing authority row, and one key's authority never covers another key.
|
|
@@ -80,6 +84,8 @@ Never use a prior Agent summary or generated resource as the next Base. Missing
|
|
|
80
84
|
|
|
81
85
|
Prepare one disclosure-reviewed JSON input using schema `design-resource-recovery-input-v4`, including session identity, Base, `authority_sources`, delegations/Deltas, exact accepted/rejected/unresolved sets, current Design Authority identity, immutable Provider project/run/resource references, `selected_resource_bindings`, one frozen `audit_expectations` catalog and optional writeback. The catalog owns the exact changed, unchanged, resource-decision, blast-radius and inactive-leakage row expectations, including Delta/resource/condition/basis/binding identities. Every resource-decision binding freezes one and only one `final_disposition`: `proposal-written` with its exact operation ID, `resource-owned-exact-visual` with its selected resource/conditions/structured owner, `not-adopted` for rejected or superseded meaning, or `unresolved` for unresolved meaning. Audit observes and verifies this owner; it never selects it. Changing an owner requires checkpoint `update` with digest CAS. The catalog is the only checkpoint audit-universe/owner owner; current audit rows must be set-equal to it rather than merely non-empty. Selected resource bindings declare one unique resource key, generic `repository-snapshot` or `external-immutable` identity, locator, raw-byte digest and exact condition identities. Arbitrary condition strings and duplicate identities fail closed.
|
|
82
86
|
|
|
87
|
+
The existing selected-resource, condition, Design-Authority and authority-Source fields jointly bind deterministic selection to the canonical selected-source digest, target, declared conditions and controlling Source/Design-Authority identity; no new selection field or status is added. Preview URLs, names and exports are derived outputs. A proved equivalent export does not change the selection binding, while a visible or semantic difference requires a new user review/selection and, when retained here, the existing digest-CAS checkpoint update.
|
|
88
|
+
|
|
83
89
|
Create/retain a checkpoint for a real interruption or pending CAS writeback; use `none` when neither exists, and `reject` when a requested new checkpoint, input, destination or existing checkpoint cannot be admitted. Never turn an invalid authority request into `none` merely because no file was written. Then explicitly create it when required:
|
|
84
90
|
|
|
85
91
|
```text
|
|
@@ -178,7 +184,7 @@ When no binding is `proposal-written`, omit writeback and do not invent an empty
|
|
|
178
184
|
ty-context design-resource recovery reconcile <session> --audit <audit.json>
|
|
179
185
|
```
|
|
180
186
|
|
|
181
|
-
Recovery uses only generic repository snapshot/source-record identity. It does not accept a `formal-handoff-target` label
|
|
187
|
+
Recovery uses only generic repository snapshot/source-record identity. It does not accept a `formal-handoff-target` label, an implementation-feasibility-readiness label, duplicate either formal parser, or persist a selected production strategy. Formal Web/App input closure remains owned by `ty-context design-resource preflight`, while production ownership remains downstream.
|
|
182
188
|
|
|
183
189
|
A valid resource-owned-only case may be `allow` plus `reconciliation-balanced` with `write_action: none`, but the helper-level `handoff_ready` projection remains false. Any later readiness claim waits for the Skill-owned composition of current Provider/resource revalidation, durable final ownership and applicable formal preflight; never infer readiness merely from a balanced read-only reconcile.
|
|
184
190
|
|
|
@@ -15,6 +15,21 @@ Extract the smallest explicit output or development boundary before interpreting
|
|
|
15
15
|
|
|
16
16
|
Rich background improves a bounded artifact. It never authorizes more artifacts. Necessary surrounding context may show where a partial feature lives, but it does not place the rest of that page or product in scope. If the user supplies a complete app plan but asks to preview one button, generate at most the one-control resource. If the user asks for design resources for one development slice, cover that slice through its material controls and conditions, not the whole background product.
|
|
17
17
|
|
|
18
|
+
When an in-scope decision exposes an outside-ceiling effect, assess and explain that effect without generating or revising the outside subjects. Return the existing `decision-required` disposition with `reason: scope-expansion-required`. The user may choose an in-scope alternative or explicitly expand scope; only then recompute the ceiling and coverage. The reason is not a new status, approval or workflow state.
|
|
19
|
+
|
|
20
|
+
For page, flow or complex-control generation, recover the available authoritative constraints before deriving a commission:
|
|
21
|
+
|
|
22
|
+
- target user/role and usage context reference;
|
|
23
|
+
- client/host/platform, input method and relevant size classes;
|
|
24
|
+
- owning Surface/Screen duty and main-versus-drilldown boundary;
|
|
25
|
+
- primary task outcome, primary work object and shortest task loop;
|
|
26
|
+
- material operation–affected-object–feedback relationships; and
|
|
27
|
+
- critical context, state, recovery and accessibility constraints.
|
|
28
|
+
|
|
29
|
+
These product and surface facts remain owned by controlling Product/Surface/Screen Source. The commission references them without becoming their owner. Separately consume `DESIGN.md` and selected exact-target/constraint Source for visual-system and selected-design conditions. Non-authoritative task-level UI/UX analysis may inform candidate comparison but cannot supply missing product or surface meaning. A feature list, screenshot, route tree, component inventory or analysis output cannot fill a missing product or surface fact; if the missing meaning materially changes the resource, return `decision-required` or request the owning Source update before Provider execution.
|
|
30
|
+
|
|
31
|
+
If the desired candidate changes durable product goals/rules/capability, page duty, primary work object/task loop, information/action/feedback placement, interaction topology, Design Authority, tokens or component-family grammar, stop and route the change to the actual Product/Surface/Screen/Design owner. Reread the updated owner before resuming selection or generation. A candidate execution defect stays within DRA and does not by itself justify a durable owner change.
|
|
32
|
+
|
|
18
33
|
## 2. Choose the intent
|
|
19
34
|
|
|
20
35
|
| Intent | User decision being supported | Default stopping point |
|
|
@@ -44,6 +59,35 @@ Preserve each supplied item's actual role:
|
|
|
44
59
|
|
|
45
60
|
An optional pre-existing planning document is one possible input. Raw notes or an initial proposal are equally valid. Never require a special intermediary format merely to make another input usable.
|
|
46
61
|
|
|
62
|
+
### Pre-generation style-application closure
|
|
63
|
+
|
|
64
|
+
Before every style-bearing Provider generation or material revision—including a simple high-fidelity preview—evaluate every current-slice style-application dimension which can materially change the output. Reuse the Provider reference's existing material-revision definition; do not create another revision classification. This closure does not apply to non-fidelity work, pure IA/flow topology, low-fidelity structure, a semantics-only state study, a read which starts no new generation, or packaging, renaming or byte-only export proved equivalent to the same canonical source.
|
|
65
|
+
|
|
66
|
+
At minimum evaluate `primary_content_priority`, `density`, `container_treatment`, `visible_vs_hit_geometry`, `preserve` and `prohibited_patterns`, plus any other obvious slice-specific style-application dimension which materially affects Provider output. These are task-local judgments, not a fixed visual-property matrix or a copy of the formal handoff Fact Universe. Every applicable dimension has exactly one of these dispositions:
|
|
67
|
+
|
|
68
|
+
| Disposition | Legal condition | Commission representation | Provider effect |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `existing-covered` | Current controlling Source or a selected `exact-target`/`constraint` completely governs the exact target, slice and declared conditions and reaches the Provider through an existing input binding | Keep that Source in its existing input binding; do not duplicate it in `style_application` | Contributes to a closed commission |
|
|
71
|
+
| `projected` | Current controlling Source and Design Authority already determine the slice-specific application, but selected input does not directly and completely express it | Put only the necessary current-slice field in the existing `style_application` envelope | Contributes to a closed commission |
|
|
72
|
+
| `not-applicable` | The dimension has no material effect on this resource and the task-local reason is explicit | Keep the reason task-local; emit no empty or placeholder field | Contributes to a closed commission |
|
|
73
|
+
| `decision-required` | Source is missing, stale, conflicting or ambiguous; a user choice is needed; delegation is insufficient; or resolution requires a durable owner change | Give the concrete natural-language reason through the existing disposition; emit no invented application meaning | Blocks the Provider run |
|
|
74
|
+
|
|
75
|
+
Use `existing-covered` only when all of the following hold:
|
|
76
|
+
|
|
77
|
+
1. current controlling Source or a selected `exact-target`/`constraint` explicitly specifies the dimension;
|
|
78
|
+
2. the specification applies to the exact target, slice and declared conditions;
|
|
79
|
+
3. the Source remains current after any owner update;
|
|
80
|
+
4. the Provider commission actually carries it through existing `inputs.exact_targets`, `inputs.constraints` or the corresponding current input binding; and
|
|
81
|
+
5. the conclusion requires no Agent inference from a generic style, name or visual impression.
|
|
82
|
+
|
|
83
|
+
Design System identity, generic Tokens, “follow the design system”, inspiration, background, an unselected candidate, Provider output, a default-only static screenshot and current-implementation evidence do not by themselves establish `existing-covered`. Current implementation may support `preserve` only when controlling Source explicitly makes the observed behavior or visual fact a preservation constraint. A Provider must not infer missing application meaning from any of these inputs, a feature list, route tree, component inventory or task-level UI/UX analysis.
|
|
84
|
+
|
|
85
|
+
For `projected`, derive only meaning already authorized by current Source and Design Authority. Do not invent product, business, interaction or design-system semantics, paste complete Tokens, copy a Provider prompt or create a persistent Projection. The actual commission envelope contains exactly the `projected` fields: omit `existing-covered` fields, keep `not-applicable` reasons task-local and never encode `decision-required` as a placeholder.
|
|
86
|
+
|
|
87
|
+
The Provider run is allowed if and only if every applicable dimension is `existing-covered`, `projected` or `not-applicable`. Any `decision-required`, undispositioned dimension or Source conflict blocks commission submission and Provider execution. When resolution changes durable Product/Surface/Screen/Design meaning, use the existing owner-first route above, reread current Source and repeat this closure before resuming DRA. Post-generation Design suitability cannot retroactively repair a commission which skipped this closure.
|
|
88
|
+
|
|
89
|
+
This judgment occurs inside the existing Source read and commission-envelope action. For a simple high-fidelity preview it adds no Provider generation, tool action, file, checkpoint, persistent state, fixed user pause, required extra conversation turn, formal handoff, manifest, bundle, preflight or complete Fact Universe. When all dimensions close, the same turn may still generate, perform minimal sanity/suitability review, show the candidate and receive a user choice. “Closure required” never means “emit a closure record.”
|
|
90
|
+
|
|
47
91
|
## 4. Derive development-corresponding coverage
|
|
48
92
|
|
|
49
93
|
For an implementation handoff, use this task-local equation:
|
|
@@ -56,6 +100,8 @@ resources to commission
|
|
|
56
100
|
|
|
57
101
|
A decision is material when changing it would materially change what the user sees, understands, can do or receives as feedback. Pure code structure and non-user-visible implementation choices are not design gaps.
|
|
58
102
|
|
|
103
|
+
For each selected existing mapping, also name the applicable target/conditions and the meaning that must be preserved. Preservation includes current product/surface meaning, exact resource-owned visual facts, state/condition coverage and component-family or Design-System lineage which the requested change does not authorize altering. Do not treat an unchanged-looking default frame as proof that its hidden states, responsive variants or inherited dependencies are preserved.
|
|
104
|
+
|
|
59
105
|
Account for the applicable meaning at each level; do not require filler for non-applicable dimensions:
|
|
60
106
|
|
|
61
107
|
| Coverage level | Material UI/UX meaning |
|
|
@@ -73,8 +119,12 @@ For every material in-scope item, record one task-local disposition: `existing-c
|
|
|
73
119
|
|
|
74
120
|
Existing coverage is sufficient only for the conditions it explicitly specifies or demonstrates. Seeing a control in one default page frame does not cover its variants, dynamic states, feedback, motion, responsive behavior or accessibility. Conversely, a selected component source may cover many control instances, so do not commission duplicate designs merely because several stable control keys map to it.
|
|
75
121
|
|
|
122
|
+
Impact assurance has two strengths. A material/recoverable loop may use the complete current `audit_expectations`, bidirectional resource bindings, explicitly unchanged universe, blast-radius universe and inactive-Delta leakage catalog owned by [recovery-and-writeback.md](recovery-and-writeback.md). An ordinary loop without those complete bindings performs only conservative impact analysis from readable Source: mark the unverified remainder, conservatively regenerate within the ceiling or return `decision-required`. Never claim that only identified resources are affected, and never expand outside the ceiling for safety.
|
|
123
|
+
|
|
76
124
|
Design resources express user-visible interaction semantics and the presentation of product rules. Business, data, permission and algorithmic rules remain owned by product/technical Source; reference those rules and show their visible consequences without inventing them or making a visual artifact their sole owner.
|
|
77
125
|
|
|
126
|
+
For a Web/App implementation handoff, visual coverage alone is insufficient. Read [implementation-feasibility.md](implementation-feasibility.md) and inspect the current platform, framework/runtime, UI system, token/theming adapter, component owners and route owners. Every material component-family × target × condition profile needs a Source-backed candidate realization or blocker before formal publication. This does not make implementation structure a design decision or put exact design values into technical Source.
|
|
127
|
+
|
|
78
128
|
### Formal selected Web/App handoff
|
|
79
129
|
|
|
80
130
|
When—and only when—the direction is final-selected for a formal Web/App implementation handoff, load [formal-selected-web-app-handoff.md](formal-selected-web-app-handoff.md). That reference owns the complete atomic Expected Fact Universe, canonical acquisition, Inspector/Census, Fact × method proof and publication rules. Exploration never loads or approximates them.
|
|
@@ -138,15 +188,40 @@ coverage:
|
|
|
138
188
|
material_needs: []
|
|
139
189
|
observable_fact_families: []
|
|
140
190
|
existing_mappings: []
|
|
191
|
+
preserve: []
|
|
141
192
|
required_content_visual: []
|
|
142
193
|
required_components_states: []
|
|
143
194
|
required_interactions_motion: []
|
|
144
195
|
required_adaptation_accessibility: []
|
|
145
196
|
inputs:
|
|
197
|
+
product_surface_constraints: []
|
|
198
|
+
technical_sources: []
|
|
146
199
|
exact_targets: []
|
|
147
200
|
constraints: []
|
|
148
201
|
inspiration: []
|
|
149
202
|
background: []
|
|
203
|
+
style_application:
|
|
204
|
+
primary_content_priority: results-table-is-primary-work-object
|
|
205
|
+
density: compact-working-density-for-results-table
|
|
206
|
+
container_treatment: one-flat-table-surface-without-card-wrapper
|
|
207
|
+
preserve: [selected-header-hierarchy]
|
|
208
|
+
prohibited_patterns: [nested-cards-around-the-primary-results-table]
|
|
209
|
+
quality_commission:
|
|
210
|
+
artifact_archetype: dashboard-data-workbench
|
|
211
|
+
primary_design_challenges: [task-hierarchy, component-reuse, dense-data-legibility]
|
|
212
|
+
visual_character:
|
|
213
|
+
desired: [calm, precise, product-specific]
|
|
214
|
+
avoid: [generic-ai-gradient, excessive-cards, arbitrary-glow]
|
|
215
|
+
content:
|
|
216
|
+
real_copy_required: true
|
|
217
|
+
realistic_data_required: true
|
|
218
|
+
placeholder_final_content_forbidden: true
|
|
219
|
+
reference_roles:
|
|
220
|
+
- { ref: selected-density-reference, role: information-density }
|
|
221
|
+
component_authoring:
|
|
222
|
+
shared_families_required: true
|
|
223
|
+
repeated_instance_specific_styling_forbidden_by_design: true
|
|
224
|
+
substrate_input_refs: [dashboard-web-feasibility]
|
|
150
225
|
selected_capability:
|
|
151
226
|
kind: runtime-discovered-kind
|
|
152
227
|
id: runtime-discovered-id
|
|
@@ -154,17 +229,19 @@ expected_entry: known-or-provider-native
|
|
|
154
229
|
review_promise: minimal-sanity | handoff-checks | selected-source-snapshot
|
|
155
230
|
```
|
|
156
231
|
|
|
157
|
-
This is an explanatory shape, not a required file or schema.
|
|
232
|
+
This is an explanatory shape, not a required file or schema; its concrete dashboard values illustrate Source-derived content and are not defaults. Include `style_application` only when material to a style-bearing commission and bind its actual values to current Design Authority, selected Source and the explicit slice. It is not a persisted Application Projection, Authority, state or acceptance record. For style-bearing generation, add an archetype-specific `quality_commission`: name the main design challenges, desired/avoided visual character, real-content obligations, the distinct role of each selected reference, design-side shared-family expectations and applicable feasibility Source. Omit irrelevant keys instead of emitting placeholders.
|
|
233
|
+
|
|
234
|
+
`repeated_instance_specific_styling_forbidden_by_design` means repeated controls in the selected resource share one component-family grammar rather than being drawn as unrelated instances. It does not assert that later production code already reuses one component. `quality_commission` is Provider input, not a persisted quality score, Authority, Gate, routing record or acceptance result. A simple high-fidelity preview does not gain another tool action or persisted side effect from these fields. Never paste or paraphrase the Open Design capability's own seed/template prompt into it.
|
|
158
235
|
|
|
159
236
|
## 9. Iterate and stop
|
|
160
237
|
|
|
161
|
-
- Keep each revision inside the original scope ceiling unless the user explicitly expands it
|
|
238
|
+
- Keep each revision inside the original scope ceiling unless the user explicitly expands it; otherwise use `decision-required` with reason `scope-expansion-required`.
|
|
162
239
|
- Reuse the current Open Design project when that preserves context and provenance; preserve the prior artifact hash before overwriting a selected candidate.
|
|
163
240
|
- Do not create low-fi, high-fi, component boards or native-platform copies merely because a process diagram lists them.
|
|
164
241
|
- For exploration, stop as soon as the requested decision is supported.
|
|
165
242
|
- For a final-selected formal Web/App implementation handoff, apply the dedicated formal reference's exact stop conditions. Honest `decision_required`, `unavailable` or capability gaps remain blocking; they cannot be called ready or authorize fidelity work.
|
|
166
243
|
|
|
167
|
-
During simple iteration, keep accepted, rejected and unresolved implications in a task-local delta buffer. Do not require or emit an interim delta after every iteration and never continuously synchronize the initial proposal. If the loop requires durable semantic replay, a selected-Proposal file writeback or cross-interruption recovery, load [recovery-and-writeback.md](recovery-and-writeback.md) and use its independent origin/decision-authority/evidence/status model plus package helper; prompt prose alone cannot establish CAS or deterministic recovery.
|
|
244
|
+
During simple iteration, keep accepted, rejected and unresolved implications in a task-local delta buffer. Do not require or emit an interim delta after every iteration and never continuously synchronize the initial proposal. If the loop requires durable semantic replay, a selected-Proposal file writeback or cross-interruption recovery, load [recovery-and-writeback.md](recovery-and-writeback.md) and use its independent origin/decision-authority/evidence/status model plus package helper; prompt prose alone cannot establish CAS or deterministic recovery. Ordinary conversational selection creates no approval record or deterministic cross-session promise; if it is lost before authorized materialization, reconfirm it. For a non-formal small request, explicit human selection or explicitly delegated selection may be consolidated and reconciled once in the same turn. For a selected formal Web/App handoff, defer reconciliation until the formal owner completes canonical closure and no newly visible decision returns to review. Reconcile only accepted decisions. If the Proposal exists only in conversation and safe materialization was not explicitly authorized, return one complete revised proposal and report cross-session deterministic recovery unavailable. Never create another intermediary planning document or mutate Context, `DESIGN.md`, code, tests or Contract.
|
|
168
245
|
|
|
169
246
|
## Worked scope examples
|
|
170
247
|
|
|
@@ -176,3 +253,38 @@ During simple iteration, keep accepted, rejected and unresolved implications in
|
|
|
176
253
|
- **Three-screen interaction flow:** select a low-fi flow and an interactive high-fi prototype only if topology and interaction/visual behavior are independently unresolved.
|
|
177
254
|
- **Local style fix with exact target:** select no new design resource and route to implementation.
|
|
178
255
|
- **Initial proposal before execution:** iterate only requested candidates, keep one task-local delta buffer, then after selection reconcile accepted decisions once. Pass the revised proposal plus selected immutable resources directly to the default Goal or `long-task-workflow`.
|
|
256
|
+
|
|
257
|
+
### Style-application worked examples
|
|
258
|
+
|
|
259
|
+
#### Example A — must block
|
|
260
|
+
|
|
261
|
+
A one-page high-fidelity preview has configured Design Authority but only generic Tokens. No selected `exact-target` or `constraint` specifies the page's primary-content priority, density or container treatment, and the commission has no corresponding projected fields. Generic system binding cannot fill those application decisions. Result: use the existing `decision-required` with concrete missing-Source reasons; the Provider run must not start.
|
|
262
|
+
|
|
263
|
+
#### Example B — complete existing coverage may omit projection
|
|
264
|
+
|
|
265
|
+
A local style-bearing revision has a current selected `exact-target` which explicitly specifies every applicable style-application dimension for the exact target and conditions, and that Source is carried through the Provider's existing exact-target input binding. Every dimension is `existing-covered`. Result: omit `style_application` rather than copying the Source, and allow the Provider run.
|
|
266
|
+
|
|
267
|
+
#### Example C — mixed closure projects only the gaps
|
|
268
|
+
|
|
269
|
+
The task-local dispositions are:
|
|
270
|
+
|
|
271
|
+
```text
|
|
272
|
+
primary_content_priority: existing-covered
|
|
273
|
+
density: projected
|
|
274
|
+
container_treatment: projected
|
|
275
|
+
visible_vs_hit_geometry: not-applicable
|
|
276
|
+
preserve: existing-covered
|
|
277
|
+
prohibited_patterns: projected
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Assume current Screen Source says the results table is the page's primary work object, current Design Authority calls for compact working density, and an adopted constraint forbids nested cards. The illustrative actual envelope contains only those three Source-derived fields:
|
|
281
|
+
|
|
282
|
+
```yaml
|
|
283
|
+
style_application:
|
|
284
|
+
density: compact-working-density-for-results-table
|
|
285
|
+
container_treatment: one-flat-table-surface-without-card-wrapper
|
|
286
|
+
prohibited_patterns:
|
|
287
|
+
- nested-cards-around-the-primary-results-table
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
All applicable dimensions are closed, so the Provider run is allowed. If any one of them instead becomes unresolved, stale or conflicting, its disposition becomes `decision-required` and the run is blocked.
|
|
@@ -29,9 +29,15 @@ export async function designResource(args) {
|
|
|
29
29
|
process.stdout.write(canonicalJson(result));
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
console.log(`Design resource handoff
|
|
32
|
+
console.log(`Design resource handoff preflight valid: ${result.handoff_path}`);
|
|
33
|
+
console.log("Input closure: valid");
|
|
33
34
|
console.log(`Scope: ${result.handoff.scope.key}`);
|
|
34
35
|
console.log(`Targets: ${result.handoff.targets.map((item) => item.key).join(", ")}`);
|
|
36
|
+
console.log(`Technical feasibility inputs: ${result.technical_feasibility_identities.length}`);
|
|
37
|
+
console.log(`Technical feasibility cells: ${result.technical_feasibility_identities.reduce((total, item) => total + item.component_family_cells, 0)}`);
|
|
38
|
+
console.log(`Technical feasibility blockers: ${result.technical_feasibility_identities.reduce((total, item) => total + item.blockers, 0)}`);
|
|
39
|
+
console.log(`Limitations: ${result.limitations.length ? result.limitations.join("; ") : "none"}`);
|
|
40
|
+
console.log("Production conformance: not evaluated");
|
|
35
41
|
if ("metrics" in result) {
|
|
36
42
|
console.log(`Coverage: ${result.manifest.subjects.length} subjects x ${result.manifest.properties.length} atomic properties (${result.rule_projections.length} symbolic Rules)`);
|
|
37
43
|
console.log(`Symbolic: ${result.metrics.semantic_obligations} semantic obligations, ${result.metrics.certificate_obligations} certificates, ${result.metrics.canonical_dag_nodes} DAG nodes, ${result.metrics.canonical_bytes} bytes`);
|
|
@@ -88,7 +94,8 @@ async function bundle(args) {
|
|
|
88
94
|
process.stdout.write(canonicalJson(result));
|
|
89
95
|
return;
|
|
90
96
|
}
|
|
91
|
-
console.log(`Design resource
|
|
97
|
+
console.log(`Design resource Source bundle published: ${result.output_directory}`);
|
|
98
|
+
console.log("Production readiness: not evaluated");
|
|
92
99
|
console.log(`Handoffs: ${result.handoffs.length}`);
|
|
93
100
|
console.log(`Targets: ${result.handoffs.map((item) => item.target_key).join(", ")}`);
|
|
94
101
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export { verifyDeliveryContract } from "./lib/long-task-verifier-v2.js";
|
|
|
10
10
|
export { runDeliveryFinalGate } from "./lib/long-task-final-v2.js";
|
|
11
11
|
export { closeDeliveryTask, type DeliveryStatusV2, doctorDeliveryTask, readDeliveryStatus, resumeDeliveryTask, stopCheckDeliveryTask, } from "./lib/long-task-status-v2.js";
|
|
12
12
|
export { readActiveLongTaskBinding, readCompiledDeliveryContract, readFinalReceipt, } from "./lib/long-task-state.js";
|
|
13
|
-
export type { BoundaryCheckDecisionV2, BoundaryCheckInputV2, CheckExecutionResultV2, CompiledDeliveryContractV2, DesignResourceHandoffBundleOptions, DesignResourceHandoffBundleResult, DesignResourceHandoffPreflightV1, DesignResourceHandoffPreflightV2, DesignResourceHandoffV1, DesignResourceHandoffV2, DesignResourceObservableRuleManifestV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicNoninterferenceArtifactV2, DesignResourceSymbolicNoninterferenceCertificateV2, DesignResourceSymbolicNoninterferenceDerivedResultV2, DesignResourceSymbolicNoninterferenceFailureWitnessV1, DesignResourceSymbolicNoninterferenceInputBindingV2, DesignResourceSymbolicNoninterferenceProofV2, DesignResourceSymbolicProofObligationV2, DesignResourceSymbolicSourceIrCertificateScopeV1, DesignResourceSymbolicSourceIrRegionV1, DesignResourceSymbolicSourceIrV1, CompiledSymbolicDenotationV1, SymbolicDenotationAxisDomain, SymbolicDenotationComplexityLimits, SymbolicDenotationPredicate, SymbolicExtensionalPointV1, SymbolicPointDenotationV1, DeliveryAssertionV2, DeliveryCheckV2, DeliveryContractV2, DeliveryOutcomeV2, EffectiveRiskLevel, ExternalConfirmationV2, FinalReceiptV2, LongTaskFindingV2, LongTaskRiskFacts, ProofSurface, ProgressRecordV2, RequestedRiskLevel, RunnerType, SourceClaimV2, TargetedVerificationResultV2, HarnessConfig, HarnessProfile, ManagedFile, SourceMapping, } from "./public-types.js";
|
|
13
|
+
export type { BoundaryCheckDecisionV2, BoundaryCheckInputV2, CheckExecutionResultV2, CompiledDeliveryContractV2, DesignResourceHandoffBundleOptions, DesignResourceHandoffBundleResult, DesignResourceHandoffPreflightV1, DesignResourceHandoffPreflightV2, DesignResourceHandoffV1, DesignResourceHandoffV2, DesignResourceImplementationFeasibilityIdentityV1, DesignResourceImplementationFeasibilityV1, DesignResourceTechnicalFeasibilityInputV1, DesignResourceObservableRuleManifestV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicNoninterferenceArtifactV2, DesignResourceSymbolicNoninterferenceCertificateV2, DesignResourceSymbolicNoninterferenceDerivedResultV2, DesignResourceSymbolicNoninterferenceFailureWitnessV1, DesignResourceSymbolicNoninterferenceInputBindingV2, DesignResourceSymbolicNoninterferenceProofV2, DesignResourceSymbolicProofObligationV2, DesignResourceSymbolicSourceIrCertificateScopeV1, DesignResourceSymbolicSourceIrRegionV1, DesignResourceSymbolicSourceIrV1, CompiledSymbolicDenotationV1, SymbolicDenotationAxisDomain, SymbolicDenotationComplexityLimits, SymbolicDenotationPredicate, SymbolicExtensionalPointV1, SymbolicPointDenotationV1, DeliveryAssertionV2, DeliveryCheckV2, DeliveryContractV2, DeliveryOutcomeV2, EffectiveRiskLevel, ExternalConfirmationV2, FinalReceiptV2, LongTaskFindingV2, LongTaskRiskFacts, ProofSurface, ProgressRecordV2, RequestedRiskLevel, RunnerType, SourceClaimV2, TargetedVerificationResultV2, HarnessConfig, HarnessProfile, ManagedFile, SourceMapping, } from "./public-types.js";
|
|
@@ -43,6 +43,11 @@ export async function publishDesignResourceHandoffBundle(options) {
|
|
|
43
43
|
if (!declaredManifestPaths.has(manifestResource.path))
|
|
44
44
|
invalid("target_manifest_not_declared", `${declaredTarget.key}:${manifestResource.path}`);
|
|
45
45
|
const preflight = await preflightParsedDesignResourceHandoff(repository, parsed);
|
|
46
|
+
const publishedTarget = preflight.handoff.targets[0];
|
|
47
|
+
if ((publishedTarget.source_profile.kind === "implementation_web" ||
|
|
48
|
+
publishedTarget.source_profile.kind === "implementation_app") &&
|
|
49
|
+
preflight.technical_feasibility_identities.length !== 1)
|
|
50
|
+
invalid("implementation_feasibility_input_required", `${publishedTarget.key}:${preflight.technical_feasibility_identities.length}`);
|
|
46
51
|
handoffSetIntegrity.consume(preflight);
|
|
47
52
|
const targetKey = preflight.handoff.targets[0].key;
|
|
48
53
|
if (seenTargets.has(targetKey))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DesignResourceHandoffV1 } from "./design-resource-handoff-types.js";
|
|
2
2
|
import type { DesignResourceHandoffV2, ParsedDesignResourceHandoffV2 } from "./design-resource-symbolic-fact-types.js";
|
|
3
|
-
export type DesignResourceHandoffManifestBackedV1 = Pick<DesignResourceHandoffV1, "schema_version" | "intent" | "scope" | "provenance" | "resources" | "targets" | "resource_fact_closure" | "coverage" | "proposal"> & {
|
|
3
|
+
export type DesignResourceHandoffManifestBackedV1 = Pick<DesignResourceHandoffV1, "schema_version" | "intent" | "scope" | "provenance" | "technical_feasibility_inputs" | "resources" | "targets" | "resource_fact_closure" | "coverage" | "proposal"> & {
|
|
4
4
|
representation: "manifest_backed";
|
|
5
5
|
};
|
|
6
6
|
export type DesignResourceHandoffInputV1 = DesignResourceHandoffV1 | DesignResourceHandoffManifestBackedV1;
|
|
@@ -11,6 +11,7 @@ export function hydrateManifestBackedDesignResourceHandoff(descriptor, manifests
|
|
|
11
11
|
intent: descriptor.intent,
|
|
12
12
|
scope: descriptor.scope,
|
|
13
13
|
provenance: descriptor.provenance,
|
|
14
|
+
technical_feasibility_inputs: descriptor.technical_feasibility_inputs,
|
|
14
15
|
resources: descriptor.resources,
|
|
15
16
|
axis_dispositions: manifest.axis_dispositions,
|
|
16
17
|
condition_exclusions: manifest.condition_exclusions,
|
|
@@ -35,6 +35,7 @@ export function createDesignResourceHandoffSetIntegrity(fail) {
|
|
|
35
35
|
sharedHeader(scope, "provenance", handoff.provenance);
|
|
36
36
|
sharedHeader(scope, "proposal", handoff.proposal);
|
|
37
37
|
sharedCollection(scope, "resources", handoff.resources);
|
|
38
|
+
sharedCollection(scope, "technical_feasibility_inputs", handoff.technical_feasibility_inputs);
|
|
38
39
|
sharedCollection(scope, "conditions", handoff.conditions);
|
|
39
40
|
sharedCollection(scope, "properties", handoff.properties);
|
|
40
41
|
sharedCollection(scope, "resource_fact_closure", handoff.resource_fact_closure);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseDesignResourceSymbolicHandoffShape } from "./design-resource-symbolic-fact-shape.js";
|
|
2
|
+
import { parseDesignResourceTechnicalFeasibilityInputs } from "./design-resource-implementation-feasibility-shape.js";
|
|
2
3
|
import { parseDesignResourceAssetBindings, parseDesignResourceAxisDispositions, parseDesignResourceConditionExclusions, parseDesignResourceEnvironments, parseDesignResourceFactCells, parseDesignResourceLineageNodes, parseDesignResourceOracles, parseDesignResourceProofObligations, parseDesignResourceProperties, parseDesignResourceVariationAxisDispositions, parseDesignResourceVariationExclusions, parseDesignResourceVariations, } from "./design-resource-fact-manifest-shape.js";
|
|
3
4
|
import { parseDesignResourceHandoffBlockers, parseDesignResourceHandoffCoverage, parseDesignResourceHandoffEvidence, parseDesignResourceHandoffFacts, parseDesignResourceHandoffResourceFactClosure, } from "./design-resource-handoff-shape-evidence.js";
|
|
4
5
|
import { contractKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
|
|
@@ -49,7 +50,7 @@ export function parseDesignResourceHandoffShape(value) {
|
|
|
49
50
|
"coverage",
|
|
50
51
|
"acceptance_blockers",
|
|
51
52
|
"proposal",
|
|
52
|
-
]);
|
|
53
|
+
], ["technical_feasibility_inputs"]);
|
|
53
54
|
const scope = object(root.scope, "design_resource_handoff.scope", [
|
|
54
55
|
"key",
|
|
55
56
|
"style_dependency",
|
|
@@ -92,6 +93,7 @@ export function parseDesignResourceHandoffShape(value) {
|
|
|
92
93
|
model: string(provenance.model, "design_resource_handoff.provenance.model"),
|
|
93
94
|
design_system_id: string(provenance.design_system_id, "design_resource_handoff.provenance.design_system_id"),
|
|
94
95
|
},
|
|
96
|
+
technical_feasibility_inputs: parseDesignResourceTechnicalFeasibilityInputs(root.technical_feasibility_inputs ?? []),
|
|
95
97
|
resources: parseDesignResourceHandoffResources(root.resources),
|
|
96
98
|
axis_dispositions: parseDesignResourceAxisDispositions(root.axis_dispositions),
|
|
97
99
|
condition_exclusions: parseDesignResourceConditionExclusions(root.condition_exclusions),
|
|
@@ -132,12 +134,13 @@ function parseManifestBackedDesignResourceHandoffShape(value) {
|
|
|
132
134
|
"resource_fact_closure",
|
|
133
135
|
"coverage",
|
|
134
136
|
"proposal",
|
|
135
|
-
]);
|
|
137
|
+
], ["technical_feasibility_inputs"]);
|
|
136
138
|
const parsed = parseDesignResourceHandoffShape({
|
|
137
139
|
schema_version: root.schema_version,
|
|
138
140
|
intent: root.intent,
|
|
139
141
|
scope: root.scope,
|
|
140
142
|
provenance: root.provenance,
|
|
143
|
+
technical_feasibility_inputs: root.technical_feasibility_inputs ?? [],
|
|
141
144
|
resources: root.resources,
|
|
142
145
|
axis_dispositions: [],
|
|
143
146
|
condition_exclusions: [],
|
|
@@ -167,6 +170,7 @@ function parseManifestBackedDesignResourceHandoffShape(value) {
|
|
|
167
170
|
intent: parsed.intent,
|
|
168
171
|
scope: parsed.scope,
|
|
169
172
|
provenance: parsed.provenance,
|
|
173
|
+
technical_feasibility_inputs: parsed.technical_feasibility_inputs,
|
|
170
174
|
resources: parsed.resources,
|
|
171
175
|
targets: parsed.targets,
|
|
172
176
|
resource_fact_closure: parsed.resource_fact_closure,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExecutionTargetCapabilityV2 } from "./execution-target-capabilities.js";
|
|
2
2
|
import type { DesignResourceAssetBindingV1, DesignResourceAxisDispositionV1, DesignResourceConditionCombinationDispositionV1, DesignResourceEnvironmentV1, DesignResourceFactCellV1, DesignResourceFactV1, DesignResourceLineageNodeV1, DesignResourceManifestCollectionName, DesignResourceOracleV1, DesignResourcePropertyDefinitionV1, DesignResourceProofObligationV1, DesignResourceRelationEndpointV1, DesignResourceSubjectKind, DesignResourceSubjectPresenceKind, DesignResourceSubjectVariationV1, DesignResourceVariationAxisDispositionV1, DesignResourceVariationCombinationDispositionV1 } from "./design-resource-fact-manifest-types.js";
|
|
3
|
+
import type { DesignResourceImplementationFeasibilityIdentityV1, DesignResourceImplementationFeasibilityV1, DesignResourceTechnicalFeasibilityInputV1 } from "./design-resource-implementation-feasibility-types.js";
|
|
3
4
|
export declare const DESIGN_RESOURCE_DIMENSIONS: readonly ["surface_flow", "visual_content", "component_control", "state_interaction", "motion", "adaptation_input", "accessibility", "assets"];
|
|
4
5
|
export type DesignResourceDimension = (typeof DESIGN_RESOURCE_DIMENSIONS)[number];
|
|
5
6
|
export declare const DESIGN_RESOURCE_EVIDENCE_KINDS: readonly ["frame", "component_variant", "prototype_state", "prototype_transition", "motion_spec", "motion_capture", "responsive_spec", "input_spec", "accessibility_spec", "semantic_tree", "token_spec", "asset", "annotation", "localization_spec", "system_ui_spec", "haptic_spec", "sound_spec", "sound_capture", "render_environment", "relation_spec"];
|
|
@@ -30,6 +31,7 @@ export interface DesignResourceHandoffV1 {
|
|
|
30
31
|
model: string;
|
|
31
32
|
design_system_id: string;
|
|
32
33
|
};
|
|
34
|
+
technical_feasibility_inputs: DesignResourceTechnicalFeasibilityInputV1[];
|
|
33
35
|
resources: DesignResourceHandoffResourceV1[];
|
|
34
36
|
axis_dispositions: DesignResourceAxisDispositionV1[];
|
|
35
37
|
condition_exclusions: DesignResourceConditionCombinationDispositionV1[];
|
|
@@ -220,6 +222,9 @@ export interface DesignResourceHandoffPreflightV1 extends ParsedDesignResourceHa
|
|
|
220
222
|
schema_version: "design-resource-handoff-preflight-v1";
|
|
221
223
|
status: "ready";
|
|
222
224
|
resource_hashes: Record<string, string>;
|
|
225
|
+
technical_feasibility_documents: DesignResourceImplementationFeasibilityV1[];
|
|
226
|
+
technical_feasibility_identities: DesignResourceImplementationFeasibilityIdentityV1[];
|
|
227
|
+
limitations: string[];
|
|
223
228
|
manifest_identities: Array<{
|
|
224
229
|
resource_ref: string;
|
|
225
230
|
path: string;
|
|
@@ -12,6 +12,8 @@ import { indexDesignResourceItems, invalidDesignResourceHandoff, requireNonempty
|
|
|
12
12
|
import { validateDesignResourceConditions, validateDesignResourceEvidence, validateDesignResourceScope, validateDesignResourceSubjects, validateDesignResourceTargets, } from "./design-resource-handoff-validation-structure.js";
|
|
13
13
|
import { assertProtectedRepositoryFile } from "./long-task-protected-files.js";
|
|
14
14
|
import { assertDesignResourceV1HandoffCapacity } from "./design-resource-v1-capacity.js";
|
|
15
|
+
import { createV1ImplementationFeasibilityTargetModel } from "./design-resource-implementation-feasibility-model.js";
|
|
16
|
+
import { readAndValidateDesignResourceImplementationFeasibility } from "./design-resource-implementation-feasibility-validation.js";
|
|
15
17
|
export async function preflightDesignResourceHandoff(repository, handoffPath) {
|
|
16
18
|
const handoffFile = await assertProtectedRepositoryFile(repository, path.resolve(repository, ...handoffPath.split("/")), "design_resource_handoff");
|
|
17
19
|
await assertDesignResourceV1HandoffCapacity(handoffFile);
|
|
@@ -46,11 +48,21 @@ export async function preflightParsedDesignResourceHandoff(repository, parsed) {
|
|
|
46
48
|
validateDesignResourceFiles(normalized, snapshot.contents);
|
|
47
49
|
validateDesignResourceFactManifests(normalized, snapshot.contents, manifests, !isManifestBacked(inputHandoff));
|
|
48
50
|
const resources = new Map(handoff.resources.map((resource) => [resource.key, resource]));
|
|
51
|
+
const feasibility = await readAndValidateDesignResourceImplementationFeasibility(repository, parsed.handoff_path, handoff.technical_feasibility_inputs, new Map(handoff.targets.map((target) => [
|
|
52
|
+
target.key,
|
|
53
|
+
createV1ImplementationFeasibilityTargetModel(handoff, target),
|
|
54
|
+
])), new Set(handoff.resources.map((resource) => resource.path)));
|
|
49
55
|
return {
|
|
50
56
|
schema_version: "design-resource-handoff-preflight-v1",
|
|
51
57
|
status: "ready",
|
|
52
58
|
...normalized,
|
|
53
59
|
resource_hashes: snapshot.hashes,
|
|
60
|
+
technical_feasibility_documents: feasibility.map((item) => item.document),
|
|
61
|
+
technical_feasibility_identities: feasibility.map((item) => item.identity),
|
|
62
|
+
limitations: handoff.targets.some((target) => target.source_profile.kind !== "reference" &&
|
|
63
|
+
!feasibility.some((item) => item.index.target_ref === target.key))
|
|
64
|
+
? ["technical feasibility not declared"]
|
|
65
|
+
: [],
|
|
54
66
|
manifest_identities: handoff.targets.map((target) => {
|
|
55
67
|
const resourceRef = target.source_profile.fact_manifest_resource_ref;
|
|
56
68
|
const resource = resources.get(resourceRef);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DesignResourceHandoffV1 } from "./design-resource-handoff-types.js";
|
|
2
|
+
import type { DesignResourceObservableRuleManifestV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicHandoffTargetV2 } from "./design-resource-symbolic-fact-types.js";
|
|
3
|
+
import type { SymbolicDenotationAxisDomain, SymbolicDenotationPredicate } from "./symbolic-denotation-types.js";
|
|
4
|
+
interface FeasibilityTargetModelBase {
|
|
5
|
+
target_ref: string;
|
|
6
|
+
source_profile_kind: "implementation_web" | "implementation_app" | "reference";
|
|
7
|
+
component_family_refs: string[];
|
|
8
|
+
component_family_subject_refs: Map<string, Set<string>>;
|
|
9
|
+
}
|
|
10
|
+
export interface DesignResourceImplementationFeasibilityV1TargetModel extends FeasibilityTargetModelBase {
|
|
11
|
+
representation: "fact_cells_v1";
|
|
12
|
+
condition_refs: string[];
|
|
13
|
+
facts: Map<string, {
|
|
14
|
+
target_ref: string;
|
|
15
|
+
subject_ref: string;
|
|
16
|
+
condition_ref: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export interface DesignResourceImplementationFeasibilityV2TargetModel extends FeasibilityTargetModelBase {
|
|
20
|
+
representation: "symbolic_rules_v2";
|
|
21
|
+
axis_domains: SymbolicDenotationAxisDomain[];
|
|
22
|
+
reachable_region: SymbolicDenotationPredicate;
|
|
23
|
+
fact_rules: Map<string, DesignResourceSymbolicFactRuleV2>;
|
|
24
|
+
}
|
|
25
|
+
export type DesignResourceImplementationFeasibilityTargetModel = DesignResourceImplementationFeasibilityV1TargetModel | DesignResourceImplementationFeasibilityV2TargetModel;
|
|
26
|
+
export declare function createV1ImplementationFeasibilityTargetModel(handoff: DesignResourceHandoffV1, target: DesignResourceHandoffV1["targets"][number]): DesignResourceImplementationFeasibilityV1TargetModel;
|
|
27
|
+
export declare function createV2ImplementationFeasibilityTargetModel(target: DesignResourceSymbolicHandoffTargetV2, manifest: DesignResourceObservableRuleManifestV2): DesignResourceImplementationFeasibilityV2TargetModel;
|
|
28
|
+
export declare function deriveComponentFamilySubjectClosure(familyRefs: string[], subjects: Array<{
|
|
29
|
+
key: string;
|
|
30
|
+
family_ref: string | null;
|
|
31
|
+
parent_ref: string | null;
|
|
32
|
+
instance_of_ref: string | null;
|
|
33
|
+
override_of_ref: string | null;
|
|
34
|
+
}>): Map<string, Set<string>>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function createV1ImplementationFeasibilityTargetModel(handoff, target) {
|
|
2
|
+
const componentFamilies = handoff.subjects.filter((subject) => subject.kind === "component_family" &&
|
|
3
|
+
subject.target_refs.includes(target.key));
|
|
4
|
+
return {
|
|
5
|
+
representation: "fact_cells_v1",
|
|
6
|
+
target_ref: target.key,
|
|
7
|
+
source_profile_kind: target.source_profile.kind,
|
|
8
|
+
component_family_refs: componentFamilies.map((subject) => subject.key),
|
|
9
|
+
component_family_subject_refs: deriveComponentFamilySubjectClosure(componentFamilies.map((subject) => subject.key), handoff.subjects),
|
|
10
|
+
condition_refs: [...target.condition_refs],
|
|
11
|
+
facts: new Map(handoff.facts.map((fact) => [
|
|
12
|
+
fact.key,
|
|
13
|
+
{
|
|
14
|
+
target_ref: fact.target_ref,
|
|
15
|
+
subject_ref: fact.subject_ref,
|
|
16
|
+
condition_ref: fact.condition_ref,
|
|
17
|
+
},
|
|
18
|
+
])),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createV2ImplementationFeasibilityTargetModel(target, manifest) {
|
|
22
|
+
const componentFamilies = manifest.subjects.filter((subject) => subject.kind === "component_family" &&
|
|
23
|
+
subject.target_refs.includes(target.key));
|
|
24
|
+
return {
|
|
25
|
+
representation: "symbolic_rules_v2",
|
|
26
|
+
target_ref: target.key,
|
|
27
|
+
source_profile_kind: target.source_profile.kind,
|
|
28
|
+
component_family_refs: componentFamilies.map((subject) => subject.key),
|
|
29
|
+
component_family_subject_refs: deriveComponentFamilySubjectClosure(componentFamilies.map((subject) => subject.key), manifest.subjects),
|
|
30
|
+
axis_domains: manifest.axis_domains,
|
|
31
|
+
reachable_region: manifest.reachable_region,
|
|
32
|
+
fact_rules: new Map(manifest.fact_rules.map((rule) => [rule.key, rule])),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function deriveComponentFamilySubjectClosure(familyRefs, subjects) {
|
|
36
|
+
const result = new Map();
|
|
37
|
+
for (const familyRef of familyRefs) {
|
|
38
|
+
const closure = new Set(subjects
|
|
39
|
+
.filter((subject) => subject.key === familyRef ||
|
|
40
|
+
subject.family_ref === familyRef ||
|
|
41
|
+
subject.instance_of_ref === familyRef)
|
|
42
|
+
.map((subject) => subject.key));
|
|
43
|
+
let changed = true;
|
|
44
|
+
while (changed) {
|
|
45
|
+
changed = false;
|
|
46
|
+
for (const subject of subjects) {
|
|
47
|
+
if (closure.has(subject.key))
|
|
48
|
+
continue;
|
|
49
|
+
if ((subject.parent_ref !== null && closure.has(subject.parent_ref)) ||
|
|
50
|
+
(subject.instance_of_ref !== null &&
|
|
51
|
+
closure.has(subject.instance_of_ref)) ||
|
|
52
|
+
(subject.override_of_ref !== null &&
|
|
53
|
+
closure.has(subject.override_of_ref))) {
|
|
54
|
+
closure.add(subject.key);
|
|
55
|
+
changed = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
result.set(familyRef, closure);
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type DesignResourceImplementationConditionModelV1 } from "./design-resource-implementation-feasibility-types.js";
|
|
2
|
+
export declare function parseConditionModel(value: unknown, label: string): DesignResourceImplementationConditionModelV1;
|
|
3
|
+
export declare function parseComponentFamilyCells(value: unknown, label: string): {
|
|
4
|
+
key: string;
|
|
5
|
+
component_family_ref: string;
|
|
6
|
+
target_ref: string;
|
|
7
|
+
condition_profile_ref: string;
|
|
8
|
+
design_fact_refs: string[];
|
|
9
|
+
feasible_realizations: {
|
|
10
|
+
key: string;
|
|
11
|
+
strategy_steps: ("compose_existing" | "create_shared_component" | "extend_shared_component" | "reuse_existing" | "theme_with_tokens")[];
|
|
12
|
+
primitive_refs: string[];
|
|
13
|
+
owner_candidates: ({
|
|
14
|
+
kind: "existing_path";
|
|
15
|
+
locator: string;
|
|
16
|
+
existence: "existing";
|
|
17
|
+
authorization_source_refs?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "planned_logical_owner";
|
|
20
|
+
locator: string;
|
|
21
|
+
existence: "planned";
|
|
22
|
+
authorization_source_refs: string[];
|
|
23
|
+
})[];
|
|
24
|
+
supported_customization_surfaces: ("behavior_slot" | "component_variant" | "composition" | "content_slot" | "icon_slot" | "primitive_props" | "style_api" | "theme_tokens")[];
|
|
25
|
+
feasibility_basis_refs: string[];
|
|
26
|
+
observed_costs: string[];
|
|
27
|
+
observed_risks: string[];
|
|
28
|
+
}[];
|
|
29
|
+
required_realization: {
|
|
30
|
+
realization_ref: string | null;
|
|
31
|
+
technical_authority_source_refs: string[];
|
|
32
|
+
};
|
|
33
|
+
blocker_refs: string[];
|
|
34
|
+
}[];
|
|
35
|
+
export declare function parseBlockers(value: unknown, label: string): {
|
|
36
|
+
key: string;
|
|
37
|
+
component_family_ref: string;
|
|
38
|
+
target_ref: string;
|
|
39
|
+
condition_profile_ref: string;
|
|
40
|
+
source_record_refs: string[];
|
|
41
|
+
substrate_observation_refs: ("component_owner_roots" | "framework_runtime" | "platform" | "route_owner_roots" | "token_theming_adapter" | "ui_system")[];
|
|
42
|
+
description: string;
|
|
43
|
+
}[];
|