project-tiny-context-harness 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +401 -395
- package/assets/README.md +628 -549
- package/assets/README.zh-CN.md +345 -339
- package/assets/agents/.gitkeep +1 -1
- package/assets/agents/AGENTS_CORE.md +70 -70
- package/assets/context_templates/architecture.md +28 -28
- package/assets/context_templates/area.md +34 -34
- package/assets/context_templates/context.toml +30 -30
- package/assets/context_templates/deployment.md +35 -35
- package/assets/context_templates/global.md +57 -57
- package/assets/context_templates/product-surface-contract.md +70 -70
- package/assets/context_templates/screen-contract.md +189 -189
- package/assets/context_templates/verification.md +32 -32
- package/assets/github/.gitkeep +1 -1
- package/assets/github/harness.yml +39 -39
- package/assets/make/.gitkeep +1 -1
- package/assets/make/ty-context.mk +48 -48
- package/assets/skills/context_development_engineer/SKILL.md +137 -137
- package/assets/skills/context_full_project_export/SKILL.md +28 -28
- package/assets/skills/context_harness_upgrade/SKILL.md +60 -60
- package/assets/skills/context_product_plan/SKILL.md +88 -88
- package/assets/skills/context_surface_contract/SKILL.md +191 -191
- package/assets/skills/context_uiux_design/SKILL.md +172 -172
- package/assets/skills/design-resource-authoring/SKILL.md +85 -85
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +136 -136
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +135 -135
- package/assets/skills/design-resource-authoring/references/resource-selection.md +173 -173
- package/assets/skills/design-system-authoring/SKILL.md +57 -57
- package/assets/skills/design-system-authoring/agents/openai.yaml +6 -6
- package/assets/skills/design-system-authoring/references/authority-adoption.md +48 -48
- package/assets/skills/design-system-authoring/references/open-design-design-system-provider.md +110 -110
- package/assets/skills/long-task-workflow/SKILL.md +100 -100
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +75 -73
- package/assets/skills/long-task-workflow/references/contract-authoring.md +119 -115
- package/assets/skills/long-task-workflow/references/evidence-design.md +77 -76
- package/assets/skills/long-task-workflow/references/source-authoring.md +102 -99
- package/assets/skills/source-plan-authoring/SKILL.md +14 -14
- package/assets/tools/validate_context.py +442 -442
- package/dist/commands/design-resource.js +2 -2
- package/dist/commands/index.js +26 -26
- package/dist/commands/long-task-authoring.js +83 -9
- package/dist/commands/long-task.js +15 -15
- package/dist/lib/context-graph-snapshot.js +7 -0
- package/dist/lib/design-resource-handoff-shape-evidence.js +3 -0
- package/dist/lib/design-resource-handoff-types.d.ts +2 -0
- package/dist/lib/design-resource-handoff-validation-coverage.js +1 -0
- package/dist/lib/design-resource-handoff-validation-structure.js +2 -0
- package/dist/lib/execution-target-capabilities.d.ts +2 -0
- package/dist/lib/execution-target-capabilities.js +31 -0
- package/dist/lib/long-task-acceptance-shape.js +81 -20
- package/dist/lib/long-task-applicability-shape.d.ts +4 -0
- package/dist/lib/long-task-applicability-shape.js +54 -0
- package/dist/lib/long-task-assertions-v2.js +8 -0
- package/dist/lib/long-task-authoring-preflight-diagnostics.js +5 -0
- package/dist/lib/long-task-authoring-preflight-repair-order.js +3 -0
- package/dist/lib/long-task-authoring-preflight.js +12 -8
- package/dist/lib/long-task-authority-materials.js +46 -4
- package/dist/lib/long-task-authority-policy.d.ts +54 -0
- package/dist/lib/long-task-authority-policy.js +61 -0
- package/dist/lib/long-task-authority-types.d.ts +12 -2
- package/dist/lib/long-task-authority.js +9 -2
- package/dist/lib/long-task-check-shape.js +6 -1
- package/dist/lib/long-task-claim-definitions.js +27 -42
- package/dist/lib/long-task-claims.js +275 -146
- package/dist/lib/long-task-contract-types.d.ts +42 -8
- package/dist/lib/long-task-control-fields.d.ts +12 -0
- package/dist/lib/long-task-control-fields.js +66 -0
- package/dist/lib/long-task-control-types.d.ts +1 -0
- package/dist/lib/long-task-control-types.js +1 -0
- package/dist/lib/long-task-counterfactual-claim-policy.js +7 -0
- package/dist/lib/long-task-counterfactual-types.d.ts +12 -0
- package/dist/lib/long-task-delivery-compiler.js +1 -0
- package/dist/lib/long-task-delivery-preflight.js +24 -0
- package/dist/lib/long-task-delivery-shape.d.ts +1 -0
- package/dist/lib/long-task-delivery-shape.js +1 -0
- package/dist/lib/long-task-delivery-types.d.ts +1 -0
- package/dist/lib/long-task-delivery-types.js +1 -0
- package/dist/lib/long-task-delivery-validation.js +46 -0
- package/dist/lib/long-task-design-resource-handoff.js +48 -7
- package/dist/lib/long-task-evidence-capability-codec.js +37 -0
- package/dist/lib/long-task-evidence-capability-policy.js +80 -38
- package/dist/lib/long-task-evidence-capability-runtime.js +36 -0
- package/dist/lib/long-task-evidence-capability-types.d.ts +13 -1
- package/dist/lib/long-task-evidence-findings.js +3 -0
- package/dist/lib/long-task-evidence-sensitivity-policy.js +38 -0
- package/dist/lib/long-task-evidence-v2.js +7 -1
- package/dist/lib/long-task-final-integrity.d.ts +16 -0
- package/dist/lib/long-task-final-integrity.js +98 -0
- package/dist/lib/long-task-final-v2.js +17 -34
- package/dist/lib/long-task-outcome-parser.js +22 -4
- package/dist/lib/long-task-playwright-case-evidence.d.ts +2 -0
- package/dist/lib/long-task-playwright-case-evidence.js +10 -2
- package/dist/lib/long-task-playwright-evidence.d.ts +1 -0
- package/dist/lib/long-task-playwright-evidence.js +32 -0
- package/dist/lib/long-task-product-shape.d.ts +3 -1
- package/dist/lib/long-task-product-shape.js +100 -4
- package/dist/lib/long-task-requirement-shape.js +3 -0
- package/dist/lib/long-task-root-shape.js +12 -6
- package/dist/lib/long-task-runner-freeze.js +16 -0
- package/dist/lib/long-task-runtime-types.d.ts +11 -2
- package/dist/lib/long-task-semantic-assurance-policy.d.ts +4 -0
- package/dist/lib/long-task-semantic-assurance-policy.js +52 -0
- package/dist/lib/long-task-semantic-contract-types.d.ts +18 -1
- package/dist/lib/long-task-semantic-drift-migration.js +33 -2
- package/dist/lib/long-task-semantic-mutation.d.ts +7 -0
- package/dist/lib/long-task-semantic-mutation.js +81 -0
- package/dist/lib/long-task-shape-primitives.d.ts +1 -1
- package/dist/lib/long-task-shape-primitives.js +1 -0
- package/dist/lib/long-task-source-authority-types.d.ts +2 -0
- package/dist/lib/long-task-source-item-parser.d.ts +1 -1
- package/dist/lib/long-task-source-item-parser.js +150 -104
- package/dist/lib/long-task-source-markers.d.ts +12 -0
- package/dist/lib/long-task-source-markers.js +146 -0
- package/dist/lib/long-task-source-target-continuity.d.ts +1 -1
- package/dist/lib/long-task-source-target-continuity.js +80 -55
- package/dist/lib/long-task-source-target-index.js +7 -29
- package/dist/lib/long-task-status-v2.d.ts +1 -0
- package/dist/lib/long-task-status-v2.js +2 -2
- package/dist/lib/long-task-target-policy.js +20 -0
- package/dist/lib/long-task-ui-design-policy.js +27 -1
- package/dist/lib/long-task-ui-surface-shape.js +21 -1
- package/dist/lib/long-task-ui-surface-types.d.ts +7 -0
- package/dist/lib/long-task-verification-preview.d.ts +10 -0
- package/dist/lib/long-task-verifier-dependency-closure.d.ts +3 -0
- package/dist/lib/long-task-verifier-dependency-closure.js +179 -0
- package/dist/lib/long-task-verifier-v2.js +12 -2
- package/dist/lib/long-task-workspace.js +5 -1
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +99 -25
- package/migrations/README.md +15 -15
- package/package.json +84 -84
- package/source-mappings.yaml +25 -25
|
@@ -22,14 +22,18 @@ export async function preflightDeliveryContract(workdirInput, projectRootInput =
|
|
|
22
22
|
}
|
|
23
23
|
const contract = parsed.contract;
|
|
24
24
|
addAuthoringDiagnostics(contract, parsed, diagnostics);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
const activeDiagnostics = [];
|
|
26
|
+
const [validation, active] = await Promise.all([
|
|
27
|
+
validateContractForActivation({
|
|
28
|
+
repository,
|
|
29
|
+
workdir,
|
|
30
|
+
contract,
|
|
31
|
+
mode: "collect",
|
|
32
|
+
diagnostics,
|
|
33
|
+
}),
|
|
34
|
+
loadAuthoringActiveAuthority(repository, workdir, activeDiagnostics),
|
|
35
|
+
]);
|
|
36
|
+
diagnostics.push(...activeDiagnostics);
|
|
33
37
|
if (validation.workspace)
|
|
34
38
|
try {
|
|
35
39
|
const changedPaths = active?.workdir === workdir
|
|
@@ -31,12 +31,20 @@ export function projectProductSemantics(contract) {
|
|
|
31
31
|
target_profile: contract.task.target_profile,
|
|
32
32
|
execution_targets: [...contract.task.execution_targets].sort(keyOrder),
|
|
33
33
|
stages: [...contract.stages].sort(keyOrder),
|
|
34
|
-
global_non_goals:
|
|
34
|
+
global_non_goals: applicableStatements(contract.global.product.non_goals),
|
|
35
35
|
outcomes: [...contract.outcomes].sort(keyOrder).map((outcome) => ({
|
|
36
36
|
key: outcome.key,
|
|
37
37
|
title: outcome.title,
|
|
38
38
|
stage: outcome.stage,
|
|
39
|
+
applicability: [...outcome.applicability].sort(keyOrder).map((item) => ({
|
|
40
|
+
...item,
|
|
41
|
+
given_refs: [...item.given_refs],
|
|
42
|
+
when_refs: [...item.when_refs],
|
|
43
|
+
})),
|
|
39
44
|
observable_result: outcome.product.observable_result,
|
|
45
|
+
result_applicability_refs: [
|
|
46
|
+
...outcome.product.result_applicability_refs,
|
|
47
|
+
].sort(),
|
|
40
48
|
success_path_required: outcome.product.success_path_required,
|
|
41
49
|
degradation_path_required: outcome.product.degradation_path_required,
|
|
42
50
|
owner: {
|
|
@@ -51,6 +59,7 @@ export function projectProductSemantics(contract) {
|
|
|
51
59
|
required_proof_surfaces: [
|
|
52
60
|
...requirement.required_proof_surfaces,
|
|
53
61
|
].sort(),
|
|
62
|
+
applicability_refs: [...requirement.applicability_refs].sort(),
|
|
54
63
|
})),
|
|
55
64
|
controls: [...outcome.product.controls].sort(keyOrder).map((control) => ({
|
|
56
65
|
key: control.key,
|
|
@@ -76,6 +85,20 @@ export function projectProductSemantics(contract) {
|
|
|
76
85
|
permission: control.permission,
|
|
77
86
|
feedback: control.feedback,
|
|
78
87
|
accessibility: control.accessibility,
|
|
88
|
+
field_coverage: [...control.field_coverage].map((entry) => ({
|
|
89
|
+
...entry,
|
|
90
|
+
fields: [...entry.fields].sort(),
|
|
91
|
+
applicability_refs: [...entry.applicability_refs].sort(),
|
|
92
|
+
})),
|
|
93
|
+
})),
|
|
94
|
+
control_relation_closure: outcome.product.control_relation_closure,
|
|
95
|
+
control_relations: [...outcome.product.control_relations]
|
|
96
|
+
.sort(keyOrder)
|
|
97
|
+
.map((relation) => ({
|
|
98
|
+
...relation,
|
|
99
|
+
control_refs: [...relation.control_refs].sort(),
|
|
100
|
+
required_proof_surfaces: [...relation.required_proof_surfaces].sort(),
|
|
101
|
+
applicability_refs: [...relation.applicability_refs].sort(),
|
|
79
102
|
})),
|
|
80
103
|
surface_bindings: [...(outcome.product.surface_bindings ?? [])]
|
|
81
104
|
.sort(keyOrder)
|
|
@@ -96,16 +119,26 @@ export function projectProductSemantics(contract) {
|
|
|
96
119
|
.map((blocker) => ({
|
|
97
120
|
...blocker,
|
|
98
121
|
refs: [...blocker.refs].sort(),
|
|
122
|
+
source_item_refs: [...blocker.source_item_refs].sort(),
|
|
123
|
+
verification_methods: [...blocker.verification_methods].sort(),
|
|
124
|
+
required_capabilities: [...blocker.required_capabilities].sort(),
|
|
99
125
|
})),
|
|
100
126
|
})),
|
|
101
|
-
non_completing_outcomes:
|
|
127
|
+
non_completing_outcomes: applicableStatements(outcome.product.non_completing_outcomes),
|
|
102
128
|
})),
|
|
103
129
|
};
|
|
104
130
|
}
|
|
105
131
|
export function projectGlobalSemantics(contract) {
|
|
106
132
|
return {
|
|
107
|
-
|
|
108
|
-
|
|
133
|
+
applicability: [...contract.global.applicability]
|
|
134
|
+
.sort(keyOrder)
|
|
135
|
+
.map((item) => ({
|
|
136
|
+
...item,
|
|
137
|
+
given_refs: [...item.given_refs],
|
|
138
|
+
when_refs: [...item.when_refs],
|
|
139
|
+
})),
|
|
140
|
+
constraints: applicableStatements(contract.global.technical.constraints),
|
|
141
|
+
forbidden_shortcuts: applicableStatements(contract.global.technical.forbidden_shortcuts),
|
|
109
142
|
};
|
|
110
143
|
}
|
|
111
144
|
function keyedStatements(values) {
|
|
@@ -113,6 +146,15 @@ function keyedStatements(values) {
|
|
|
113
146
|
.sort(keyOrder)
|
|
114
147
|
.map(({ key, statement }) => ({ key, statement }));
|
|
115
148
|
}
|
|
149
|
+
function applicableStatements(values) {
|
|
150
|
+
return [...values]
|
|
151
|
+
.sort(keyOrder)
|
|
152
|
+
.map(({ key, statement, applicability_refs }) => ({
|
|
153
|
+
key,
|
|
154
|
+
statement,
|
|
155
|
+
applicability_refs: [...applicability_refs].sort(),
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
116
158
|
function keyOrder(left, right) {
|
|
117
159
|
return left.key.localeCompare(right.key);
|
|
118
160
|
}
|
|
@@ -35,6 +35,12 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
35
35
|
requested_level: "semantic_user_review";
|
|
36
36
|
facts: "semantic_user_review";
|
|
37
37
|
};
|
|
38
|
+
readonly global: {
|
|
39
|
+
applicability: "semantic_user_review";
|
|
40
|
+
product: "semantic_user_review";
|
|
41
|
+
technical: "semantic_user_review";
|
|
42
|
+
acceptance: "proof_additive";
|
|
43
|
+
};
|
|
38
44
|
readonly global_product: {
|
|
39
45
|
non_goals: "semantic_user_review";
|
|
40
46
|
};
|
|
@@ -53,18 +59,35 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
53
59
|
title: "descriptive_non_authoritative";
|
|
54
60
|
stage: "semantic_user_review";
|
|
55
61
|
depends_on: "readiness_only";
|
|
62
|
+
applicability: "semantic_user_review";
|
|
56
63
|
product: "semantic_user_review";
|
|
57
64
|
technical: "semantic_user_review";
|
|
58
65
|
acceptance: "proof_additive";
|
|
59
66
|
};
|
|
67
|
+
readonly claim_applicability: {
|
|
68
|
+
key: "identity";
|
|
69
|
+
target_ref: "semantic_user_review";
|
|
70
|
+
journey_role: "semantic_user_review";
|
|
71
|
+
dimensions: "semantic_user_review";
|
|
72
|
+
given_refs: "semantic_user_review";
|
|
73
|
+
when_refs: "semantic_user_review";
|
|
74
|
+
};
|
|
75
|
+
readonly applicable_statement: {
|
|
76
|
+
key: "identity";
|
|
77
|
+
statement: "semantic_user_review";
|
|
78
|
+
applicability_refs: "semantic_user_review";
|
|
79
|
+
};
|
|
60
80
|
readonly outcome_product: {
|
|
61
81
|
observable_result: "semantic_user_review";
|
|
82
|
+
result_applicability_refs: "semantic_user_review";
|
|
62
83
|
success_path_required: "semantic_user_review";
|
|
63
84
|
degradation_path_required: "semantic_user_review";
|
|
64
85
|
owner: "semantic_user_review";
|
|
65
86
|
requirements: "semantic_user_review";
|
|
66
87
|
owner_surfaces: "semantic_user_review";
|
|
67
88
|
controls: "semantic_user_review";
|
|
89
|
+
control_relation_closure: "semantic_user_review";
|
|
90
|
+
control_relations: "semantic_user_review";
|
|
68
91
|
surface_bindings: "semantic_user_review";
|
|
69
92
|
non_completing_outcomes: "semantic_user_review";
|
|
70
93
|
};
|
|
@@ -72,6 +95,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
72
95
|
key: "identity";
|
|
73
96
|
statement: "semantic_user_review";
|
|
74
97
|
required_proof_surfaces: "proof_additive";
|
|
98
|
+
applicability_refs: "semantic_user_review";
|
|
75
99
|
};
|
|
76
100
|
readonly owner: {
|
|
77
101
|
label: "identity";
|
|
@@ -102,6 +126,25 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
102
126
|
permission: "semantic_user_review";
|
|
103
127
|
feedback: "semantic_user_review";
|
|
104
128
|
accessibility: "semantic_user_review";
|
|
129
|
+
field_coverage: "semantic_user_review";
|
|
130
|
+
};
|
|
131
|
+
readonly control_field_coverage: {
|
|
132
|
+
fields: "semantic_user_review";
|
|
133
|
+
state: "semantic_user_review";
|
|
134
|
+
statement: "semantic_user_review";
|
|
135
|
+
applicability_refs: "semantic_user_review";
|
|
136
|
+
};
|
|
137
|
+
readonly control_relation_closure: {
|
|
138
|
+
state: "semantic_user_review";
|
|
139
|
+
statement: "semantic_user_review";
|
|
140
|
+
applicability_refs: "semantic_user_review";
|
|
141
|
+
};
|
|
142
|
+
readonly control_relation: {
|
|
143
|
+
key: "identity";
|
|
144
|
+
statement: "semantic_user_review";
|
|
145
|
+
applicability_refs: "semantic_user_review";
|
|
146
|
+
control_refs: "semantic_user_review";
|
|
147
|
+
required_proof_surfaces: "proof_additive";
|
|
105
148
|
};
|
|
106
149
|
readonly surface_binding: {
|
|
107
150
|
key: "identity";
|
|
@@ -127,12 +170,18 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
127
170
|
actual_artifact_path: "output_requirement";
|
|
128
171
|
comparison_artifact_path: "output_requirement";
|
|
129
172
|
};
|
|
173
|
+
readonly design_verification_binding: {
|
|
174
|
+
method: "proof_additive";
|
|
175
|
+
assertion_ref: "proof_additive";
|
|
176
|
+
evidence_artifacts: "output_requirement";
|
|
177
|
+
};
|
|
130
178
|
readonly design_blocker: {
|
|
131
179
|
key: "identity";
|
|
132
180
|
status: "semantic_user_review";
|
|
133
181
|
refs: "semantic_user_review";
|
|
134
182
|
source_item_refs: "semantic_user_review";
|
|
135
183
|
verification_methods: "proof_additive";
|
|
184
|
+
required_capabilities: "semantic_user_review";
|
|
136
185
|
rationale: "semantic_user_review";
|
|
137
186
|
};
|
|
138
187
|
readonly outcome_technical: {
|
|
@@ -148,6 +197,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
148
197
|
key: "identity";
|
|
149
198
|
statement: "semantic_user_review";
|
|
150
199
|
required_proof_surfaces: "proof_additive";
|
|
200
|
+
applicability_refs: "semantic_user_review";
|
|
151
201
|
};
|
|
152
202
|
readonly binding: {
|
|
153
203
|
key: "identity";
|
|
@@ -186,6 +236,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
186
236
|
key: "identity";
|
|
187
237
|
criterion: "semantic_user_review";
|
|
188
238
|
claims: "proof_additive";
|
|
239
|
+
applicability_ref: "proof_additive";
|
|
189
240
|
observation: "proof_additive";
|
|
190
241
|
evidence_capabilities: "proof_additive";
|
|
191
242
|
operator: "proof_additive";
|
|
@@ -203,6 +254,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
203
254
|
};
|
|
204
255
|
readonly population: {
|
|
205
256
|
check_key: "proof_additive";
|
|
257
|
+
universe_binding_key: "proof_additive";
|
|
206
258
|
claims: "proof_additive";
|
|
207
259
|
observations: "proof_additive";
|
|
208
260
|
exclusion_rules: "proof_additive";
|
|
@@ -214,6 +266,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
214
266
|
check_key: "proof_additive";
|
|
215
267
|
mutation: "proof_additive";
|
|
216
268
|
expected_assertion_failures: "proof_additive";
|
|
269
|
+
preserved_assertions: "proof_additive";
|
|
217
270
|
};
|
|
218
271
|
readonly global_counterfactual: {
|
|
219
272
|
key: "identity";
|
|
@@ -222,6 +275,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
|
|
|
222
275
|
check_key: "proof_additive";
|
|
223
276
|
mutation: "proof_additive";
|
|
224
277
|
expected_assertion_failures: "proof_additive";
|
|
278
|
+
preserved_assertions: "proof_additive";
|
|
225
279
|
};
|
|
226
280
|
};
|
|
227
281
|
export declare function projectFieldsByPolicy<T extends object>(value: T, policy: Record<keyof T, AuthorityFieldPolicy>, included: ReadonlySet<AuthorityFieldPolicy>): Partial<T>;
|
|
@@ -18,6 +18,12 @@ const RISK_AUTHORITY_POLICY = {
|
|
|
18
18
|
requested_level: "semantic_user_review",
|
|
19
19
|
facts: "semantic_user_review",
|
|
20
20
|
};
|
|
21
|
+
const GLOBAL_AUTHORITY_POLICY = {
|
|
22
|
+
applicability: "semantic_user_review",
|
|
23
|
+
product: "semantic_user_review",
|
|
24
|
+
technical: "semantic_user_review",
|
|
25
|
+
acceptance: "proof_additive",
|
|
26
|
+
};
|
|
21
27
|
const GLOBAL_PRODUCT_AUTHORITY_POLICY = {
|
|
22
28
|
non_goals: "semantic_user_review",
|
|
23
29
|
};
|
|
@@ -36,18 +42,35 @@ const OUTCOME_AUTHORITY_POLICY = {
|
|
|
36
42
|
title: "descriptive_non_authoritative",
|
|
37
43
|
stage: "semantic_user_review",
|
|
38
44
|
depends_on: "readiness_only",
|
|
45
|
+
applicability: "semantic_user_review",
|
|
39
46
|
product: "semantic_user_review",
|
|
40
47
|
technical: "semantic_user_review",
|
|
41
48
|
acceptance: "proof_additive",
|
|
42
49
|
};
|
|
50
|
+
const CLAIM_APPLICABILITY_AUTHORITY_POLICY = {
|
|
51
|
+
key: "identity",
|
|
52
|
+
target_ref: "semantic_user_review",
|
|
53
|
+
journey_role: "semantic_user_review",
|
|
54
|
+
dimensions: "semantic_user_review",
|
|
55
|
+
given_refs: "semantic_user_review",
|
|
56
|
+
when_refs: "semantic_user_review",
|
|
57
|
+
};
|
|
58
|
+
const APPLICABLE_STATEMENT_AUTHORITY_POLICY = {
|
|
59
|
+
key: "identity",
|
|
60
|
+
statement: "semantic_user_review",
|
|
61
|
+
applicability_refs: "semantic_user_review",
|
|
62
|
+
};
|
|
43
63
|
const OUTCOME_PRODUCT_AUTHORITY_POLICY = {
|
|
44
64
|
observable_result: "semantic_user_review",
|
|
65
|
+
result_applicability_refs: "semantic_user_review",
|
|
45
66
|
success_path_required: "semantic_user_review",
|
|
46
67
|
degradation_path_required: "semantic_user_review",
|
|
47
68
|
owner: "semantic_user_review",
|
|
48
69
|
requirements: "semantic_user_review",
|
|
49
70
|
owner_surfaces: "semantic_user_review",
|
|
50
71
|
controls: "semantic_user_review",
|
|
72
|
+
control_relation_closure: "semantic_user_review",
|
|
73
|
+
control_relations: "semantic_user_review",
|
|
51
74
|
surface_bindings: "semantic_user_review",
|
|
52
75
|
non_completing_outcomes: "semantic_user_review",
|
|
53
76
|
};
|
|
@@ -55,6 +78,7 @@ const REQUIREMENT_AUTHORITY_POLICY = {
|
|
|
55
78
|
key: "identity",
|
|
56
79
|
statement: "semantic_user_review",
|
|
57
80
|
required_proof_surfaces: "proof_additive",
|
|
81
|
+
applicability_refs: "semantic_user_review",
|
|
58
82
|
};
|
|
59
83
|
const OWNER_AUTHORITY_POLICY = {
|
|
60
84
|
label: "identity",
|
|
@@ -85,6 +109,25 @@ const CONTROL_AUTHORITY_POLICY = {
|
|
|
85
109
|
permission: "semantic_user_review",
|
|
86
110
|
feedback: "semantic_user_review",
|
|
87
111
|
accessibility: "semantic_user_review",
|
|
112
|
+
field_coverage: "semantic_user_review",
|
|
113
|
+
};
|
|
114
|
+
const CONTROL_FIELD_COVERAGE_AUTHORITY_POLICY = {
|
|
115
|
+
fields: "semantic_user_review",
|
|
116
|
+
state: "semantic_user_review",
|
|
117
|
+
statement: "semantic_user_review",
|
|
118
|
+
applicability_refs: "semantic_user_review",
|
|
119
|
+
};
|
|
120
|
+
const CONTROL_RELATION_CLOSURE_AUTHORITY_POLICY = {
|
|
121
|
+
state: "semantic_user_review",
|
|
122
|
+
statement: "semantic_user_review",
|
|
123
|
+
applicability_refs: "semantic_user_review",
|
|
124
|
+
};
|
|
125
|
+
const CONTROL_RELATION_AUTHORITY_POLICY = {
|
|
126
|
+
key: "identity",
|
|
127
|
+
statement: "semantic_user_review",
|
|
128
|
+
applicability_refs: "semantic_user_review",
|
|
129
|
+
control_refs: "semantic_user_review",
|
|
130
|
+
required_proof_surfaces: "proof_additive",
|
|
88
131
|
};
|
|
89
132
|
const SURFACE_BINDING_AUTHORITY_POLICY = {
|
|
90
133
|
key: "identity",
|
|
@@ -110,12 +153,18 @@ const DESIGN_TARGET_AUTHORITY_POLICY = {
|
|
|
110
153
|
actual_artifact_path: "output_requirement",
|
|
111
154
|
comparison_artifact_path: "output_requirement",
|
|
112
155
|
};
|
|
156
|
+
const DESIGN_VERIFICATION_BINDING_AUTHORITY_POLICY = {
|
|
157
|
+
method: "proof_additive",
|
|
158
|
+
assertion_ref: "proof_additive",
|
|
159
|
+
evidence_artifacts: "output_requirement",
|
|
160
|
+
};
|
|
113
161
|
const DESIGN_BLOCKER_AUTHORITY_POLICY = {
|
|
114
162
|
key: "identity",
|
|
115
163
|
status: "semantic_user_review",
|
|
116
164
|
refs: "semantic_user_review",
|
|
117
165
|
source_item_refs: "semantic_user_review",
|
|
118
166
|
verification_methods: "proof_additive",
|
|
167
|
+
required_capabilities: "semantic_user_review",
|
|
119
168
|
rationale: "semantic_user_review",
|
|
120
169
|
};
|
|
121
170
|
const OUTCOME_TECHNICAL_AUTHORITY_POLICY = {
|
|
@@ -131,6 +180,7 @@ const OBLIGATION_AUTHORITY_POLICY = {
|
|
|
131
180
|
key: "identity",
|
|
132
181
|
statement: "semantic_user_review",
|
|
133
182
|
required_proof_surfaces: "proof_additive",
|
|
183
|
+
applicability_refs: "semantic_user_review",
|
|
134
184
|
};
|
|
135
185
|
const BINDING_AUTHORITY_POLICY = {
|
|
136
186
|
key: "identity",
|
|
@@ -169,6 +219,7 @@ const ASSERTION_AUTHORITY_POLICY = {
|
|
|
169
219
|
key: "identity",
|
|
170
220
|
criterion: "semantic_user_review",
|
|
171
221
|
claims: "proof_additive",
|
|
222
|
+
applicability_ref: "proof_additive",
|
|
172
223
|
observation: "proof_additive",
|
|
173
224
|
evidence_capabilities: "proof_additive",
|
|
174
225
|
operator: "proof_additive",
|
|
@@ -186,6 +237,7 @@ const RUNNER_AUTHORITY_POLICY = {
|
|
|
186
237
|
};
|
|
187
238
|
const POPULATION_AUTHORITY_POLICY = {
|
|
188
239
|
check_key: "proof_additive",
|
|
240
|
+
universe_binding_key: "proof_additive",
|
|
189
241
|
claims: "proof_additive",
|
|
190
242
|
observations: "proof_additive",
|
|
191
243
|
exclusion_rules: "proof_additive",
|
|
@@ -197,6 +249,7 @@ const COUNTERFACTUAL_AUTHORITY_POLICY = {
|
|
|
197
249
|
check_key: "proof_additive",
|
|
198
250
|
mutation: "proof_additive",
|
|
199
251
|
expected_assertion_failures: "proof_additive",
|
|
252
|
+
preserved_assertions: "proof_additive",
|
|
200
253
|
};
|
|
201
254
|
const GLOBAL_COUNTERFACTUAL_AUTHORITY_POLICY = {
|
|
202
255
|
key: "identity",
|
|
@@ -205,21 +258,29 @@ const GLOBAL_COUNTERFACTUAL_AUTHORITY_POLICY = {
|
|
|
205
258
|
check_key: "proof_additive",
|
|
206
259
|
mutation: "proof_additive",
|
|
207
260
|
expected_assertion_failures: "proof_additive",
|
|
261
|
+
preserved_assertions: "proof_additive",
|
|
208
262
|
};
|
|
209
263
|
export const AUTHORITY_FIELD_POLICY_REGISTRIES = {
|
|
210
264
|
task: TASK_AUTHORITY_POLICY,
|
|
211
265
|
source_claim: SOURCE_CLAIM_AUTHORITY_POLICY,
|
|
212
266
|
risk: RISK_AUTHORITY_POLICY,
|
|
267
|
+
global: GLOBAL_AUTHORITY_POLICY,
|
|
213
268
|
global_product: GLOBAL_PRODUCT_AUTHORITY_POLICY,
|
|
214
269
|
global_technical: GLOBAL_TECHNICAL_AUTHORITY_POLICY,
|
|
215
270
|
global_acceptance: GLOBAL_ACCEPTANCE_AUTHORITY_POLICY,
|
|
216
271
|
outcome: OUTCOME_AUTHORITY_POLICY,
|
|
272
|
+
claim_applicability: CLAIM_APPLICABILITY_AUTHORITY_POLICY,
|
|
273
|
+
applicable_statement: APPLICABLE_STATEMENT_AUTHORITY_POLICY,
|
|
217
274
|
outcome_product: OUTCOME_PRODUCT_AUTHORITY_POLICY,
|
|
218
275
|
requirement: REQUIREMENT_AUTHORITY_POLICY,
|
|
219
276
|
owner: OWNER_AUTHORITY_POLICY,
|
|
220
277
|
control: CONTROL_AUTHORITY_POLICY,
|
|
278
|
+
control_field_coverage: CONTROL_FIELD_COVERAGE_AUTHORITY_POLICY,
|
|
279
|
+
control_relation_closure: CONTROL_RELATION_CLOSURE_AUTHORITY_POLICY,
|
|
280
|
+
control_relation: CONTROL_RELATION_AUTHORITY_POLICY,
|
|
221
281
|
surface_binding: SURFACE_BINDING_AUTHORITY_POLICY,
|
|
222
282
|
design_target: DESIGN_TARGET_AUTHORITY_POLICY,
|
|
283
|
+
design_verification_binding: DESIGN_VERIFICATION_BINDING_AUTHORITY_POLICY,
|
|
223
284
|
design_blocker: DESIGN_BLOCKER_AUTHORITY_POLICY,
|
|
224
285
|
outcome_technical: OUTCOME_TECHNICAL_AUTHORITY_POLICY,
|
|
225
286
|
obligation: OBLIGATION_AUTHORITY_POLICY,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ProofSurface } from "./long-task-contract-types.js";
|
|
2
|
-
import type { DeliveryStageV2, ExecutionTargetV2, TargetProfileV2 } from "./long-task-semantic-contract-types.js";
|
|
1
|
+
import type { DeliveryControlV2, DeliveryOutcomeV2, ProofSurface } from "./long-task-contract-types.js";
|
|
2
|
+
import type { ClaimApplicabilityV2, DeliveryStageV2, ExecutionTargetV2, TargetProfileV2 } from "./long-task-semantic-contract-types.js";
|
|
3
3
|
import type { DeliverySurfaceBindingV2 } from "./long-task-ui-surface-types.js";
|
|
4
4
|
import type { CompiledSourceItemV2 } from "./long-task-source-authority-types.js";
|
|
5
5
|
import type { WorkspaceManifestV2 } from "./long-task-workspace-runtime-types.js";
|
|
@@ -18,12 +18,15 @@ export interface ProductSemanticProjectionV2 {
|
|
|
18
18
|
global_non_goals: Array<{
|
|
19
19
|
key: string;
|
|
20
20
|
statement: string;
|
|
21
|
+
applicability_refs: string[];
|
|
21
22
|
}>;
|
|
22
23
|
outcomes: Array<{
|
|
23
24
|
key: string;
|
|
24
25
|
title: string;
|
|
25
26
|
stage: string;
|
|
27
|
+
applicability: ClaimApplicabilityV2[];
|
|
26
28
|
observable_result: string;
|
|
29
|
+
result_applicability_refs: string[];
|
|
27
30
|
success_path_required: boolean;
|
|
28
31
|
degradation_path_required: boolean;
|
|
29
32
|
owner: {
|
|
@@ -34,6 +37,7 @@ export interface ProductSemanticProjectionV2 {
|
|
|
34
37
|
key: string;
|
|
35
38
|
statement: string;
|
|
36
39
|
required_proof_surfaces: ProofSurface[];
|
|
40
|
+
applicability_refs: string[];
|
|
37
41
|
}>;
|
|
38
42
|
controls: Array<{
|
|
39
43
|
key: string;
|
|
@@ -59,7 +63,10 @@ export interface ProductSemanticProjectionV2 {
|
|
|
59
63
|
permission: string;
|
|
60
64
|
feedback: string;
|
|
61
65
|
accessibility: string;
|
|
66
|
+
field_coverage: DeliveryControlV2["field_coverage"];
|
|
62
67
|
}>;
|
|
68
|
+
control_relation_closure: DeliveryOutcomeV2["product"]["control_relation_closure"];
|
|
69
|
+
control_relations: DeliveryOutcomeV2["product"]["control_relations"];
|
|
63
70
|
surface_bindings: DeliverySurfaceBindingV2[];
|
|
64
71
|
non_completing_outcomes: Array<{
|
|
65
72
|
key: string;
|
|
@@ -68,13 +75,16 @@ export interface ProductSemanticProjectionV2 {
|
|
|
68
75
|
}>;
|
|
69
76
|
}
|
|
70
77
|
export interface GlobalSemanticProjectionV2 {
|
|
78
|
+
applicability: ClaimApplicabilityV2[];
|
|
71
79
|
constraints: Array<{
|
|
72
80
|
key: string;
|
|
73
81
|
statement: string;
|
|
82
|
+
applicability_refs: string[];
|
|
74
83
|
}>;
|
|
75
84
|
forbidden_shortcuts: Array<{
|
|
76
85
|
key: string;
|
|
77
86
|
statement: string;
|
|
87
|
+
applicability_refs: string[];
|
|
78
88
|
}>;
|
|
79
89
|
}
|
|
80
90
|
export interface ContextAuthoritySnapshotV2 {
|
|
@@ -23,10 +23,14 @@ export function computeAuthorityHashes(contract) {
|
|
|
23
23
|
target_profile: contract.task.target_profile,
|
|
24
24
|
execution_targets: contract.task.execution_targets,
|
|
25
25
|
stages: contract.stages,
|
|
26
|
-
global:
|
|
26
|
+
global: {
|
|
27
|
+
applicability: contract.global.applicability,
|
|
28
|
+
product: contract.global.product,
|
|
29
|
+
},
|
|
27
30
|
outcomes: contract.outcomes.map((outcome) => ({
|
|
28
31
|
key: outcome.key,
|
|
29
32
|
stage: outcome.stage,
|
|
33
|
+
applicability: outcome.applicability,
|
|
30
34
|
product: outcome.product,
|
|
31
35
|
})),
|
|
32
36
|
}),
|
|
@@ -56,6 +60,7 @@ export function computeAuthorityHashes(contract) {
|
|
|
56
60
|
export function outcomeAuthorityHash(outcome) {
|
|
57
61
|
return hash({
|
|
58
62
|
stage: outcome.stage,
|
|
63
|
+
applicability: outcome.applicability,
|
|
59
64
|
product: outcome.product,
|
|
60
65
|
acceptance: {
|
|
61
66
|
checks: outcome.acceptance.checks.map(acceptanceCheck),
|
|
@@ -146,6 +151,7 @@ function assertionsStrengthened(previous, next) {
|
|
|
146
151
|
if (!nextAssertion ||
|
|
147
152
|
previousAssertion.criterion !== nextAssertion.criterion ||
|
|
148
153
|
!same(previousAssertion.claims, nextAssertion.claims) ||
|
|
154
|
+
previousAssertion.applicability_ref !== nextAssertion.applicability_ref ||
|
|
149
155
|
previousAssertion.observation !== nextAssertion.observation ||
|
|
150
156
|
previousAssertion.operator !== nextAssertion.operator ||
|
|
151
157
|
!same(previousAssertion.expected, nextAssertion.expected) ||
|
|
@@ -160,7 +166,8 @@ function counterfactualsStrengthened(previous, next) {
|
|
|
160
166
|
candidate.check_key === control.check_key &&
|
|
161
167
|
same(candidate.mutation, control.mutation) &&
|
|
162
168
|
subset(control.claims, candidate.claims) &&
|
|
163
|
-
subset(control.expected_assertion_failures, candidate.expected_assertion_failures)
|
|
169
|
+
subset(control.expected_assertion_failures, candidate.expected_assertion_failures) &&
|
|
170
|
+
subset(control.preserved_assertions, candidate.preserved_assertions)));
|
|
164
171
|
}
|
|
165
172
|
function subset(previous, next) {
|
|
166
173
|
const available = new Set(next.map((item) => canonicalValueJson(item)));
|
|
@@ -89,7 +89,7 @@ function parseRunner(value, label) {
|
|
|
89
89
|
function parseAssertions(value, label) {
|
|
90
90
|
return array(value, label).map((item, index) => {
|
|
91
91
|
const itemLabel = `${label}[${index}]`;
|
|
92
|
-
const row = object(item, itemLabel, ["key", "claims", "observation", "operator", "evidence_capabilities"], ["criterion", "expected"]);
|
|
92
|
+
const row = object(item, itemLabel, ["key", "claims", "observation", "operator", "evidence_capabilities"], ["criterion", "applicability_ref", "expected"]);
|
|
93
93
|
const operator = literal(row.operator, [
|
|
94
94
|
"equals",
|
|
95
95
|
"not_equals",
|
|
@@ -121,6 +121,11 @@ function parseAssertions(value, label) {
|
|
|
121
121
|
? { criterion: string(row.criterion, `${itemLabel}.criterion`) }
|
|
122
122
|
: {}),
|
|
123
123
|
claims: strings(row.claims, `${itemLabel}.claims`),
|
|
124
|
+
...(Object.hasOwn(row, "applicability_ref")
|
|
125
|
+
? {
|
|
126
|
+
applicability_ref: key(row.applicability_ref, `${itemLabel}.applicability_ref`),
|
|
127
|
+
}
|
|
128
|
+
: {}),
|
|
124
129
|
observation: string(row.observation, `${itemLabel}.observation`),
|
|
125
130
|
evidence_capabilities: array(row.evidence_capabilities, `${itemLabel}.evidence_capabilities`).map((capability, capabilityIndex) => literal(capability, EVIDENCE_CAPABILITIES, `${itemLabel}.evidence_capabilities[${capabilityIndex}]`)),
|
|
126
131
|
operator,
|
|
@@ -1,61 +1,43 @@
|
|
|
1
|
+
import { controlFieldFacts } from "./long-task-control-fields.js";
|
|
1
2
|
import { fail } from "./long-task-delivery-shape.js";
|
|
2
3
|
export function generateClaims(outcome) {
|
|
3
|
-
const claims = [
|
|
4
|
+
const claims = [
|
|
5
|
+
claim(outcome.key, "result", "result", [], outcome.product.result_applicability_refs),
|
|
6
|
+
];
|
|
4
7
|
for (const requirement of outcome.product.requirements)
|
|
5
|
-
claims.push(claim(outcome.key, `requirement.${requirement.key}`, "requirement", requirement.required_proof_surfaces));
|
|
8
|
+
claims.push(claim(outcome.key, `requirement.${requirement.key}`, "requirement", requirement.required_proof_surfaces, requirement.applicability_refs));
|
|
6
9
|
for (const control of outcome.product.controls) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
["region", control.region],
|
|
10
|
-
["location", control.location],
|
|
11
|
-
["control_type", control.control_type],
|
|
12
|
-
["label_content", control.label_content],
|
|
13
|
-
["user_task", control.user_task],
|
|
14
|
-
["visibility", control.visibility],
|
|
15
|
-
["availability", control.availability],
|
|
16
|
-
["trigger", control.trigger],
|
|
17
|
-
["input", control.input],
|
|
18
|
-
["validation", control.validation],
|
|
19
|
-
["default_value", control.default_value],
|
|
20
|
-
["interaction", control.interaction],
|
|
21
|
-
["navigation_result", control.navigation_result],
|
|
22
|
-
["loading", control.loading_state],
|
|
23
|
-
["empty", control.empty_state],
|
|
24
|
-
["success", control.success_state],
|
|
25
|
-
["failure", control.failure_state],
|
|
26
|
-
["recovery", control.recovery],
|
|
27
|
-
["permission", control.permission],
|
|
28
|
-
["feedback", control.feedback],
|
|
29
|
-
["accessibility", control.accessibility],
|
|
30
|
-
];
|
|
31
|
-
for (const [field, value] of fields)
|
|
32
|
-
if (value.trim())
|
|
33
|
-
claims.push(claim(outcome.key, `control.${control.key}.${field}`, "control"));
|
|
10
|
+
for (const field of controlFieldFacts(control))
|
|
11
|
+
claims.push(claim(outcome.key, `control.${control.key}.${field.claim_field}`, "control", [], field.applicability_refs, field.state === "not_applicable" ? "negative" : "positive"));
|
|
34
12
|
}
|
|
13
|
+
if (outcome.product.control_relation_closure.state !== "unresolved")
|
|
14
|
+
claims.push(claim(outcome.key, "control_relation_closure", "control_relation", [], outcome.product.control_relation_closure.applicability_refs, outcome.product.control_relation_closure.state === "not_applicable"
|
|
15
|
+
? "negative"
|
|
16
|
+
: "positive"));
|
|
17
|
+
for (const relation of outcome.product.control_relations)
|
|
18
|
+
claims.push(claim(outcome.key, `control_relation.${relation.key}`, "control_relation", relation.required_proof_surfaces, relation.applicability_refs));
|
|
35
19
|
for (const item of outcome.product.non_completing_outcomes)
|
|
36
|
-
claims.push(claim(outcome.key, `non_completing.${item.key}`, "non_completing"));
|
|
20
|
+
claims.push(claim(outcome.key, `non_completing.${item.key}`, "non_completing", [], item.applicability_refs, "negative"));
|
|
37
21
|
for (const item of outcome.technical.obligations)
|
|
38
|
-
claims.push(claim(outcome.key, `obligation.${item.key}`, "obligation", item.required_proof_surfaces));
|
|
22
|
+
claims.push(claim(outcome.key, `obligation.${item.key}`, "obligation", item.required_proof_surfaces, item.applicability_refs));
|
|
39
23
|
for (const item of outcome.technical.forbidden_shortcuts)
|
|
40
|
-
claims.push(claim(outcome.key, `forbidden_shortcut.${item.key}`, "forbidden_shortcut"));
|
|
24
|
+
claims.push(claim(outcome.key, `forbidden_shortcut.${item.key}`, "forbidden_shortcut", [], item.applicability_refs, "negative"));
|
|
41
25
|
return claims;
|
|
42
26
|
}
|
|
43
27
|
export function generateGlobalClaims(global) {
|
|
44
28
|
return [
|
|
45
|
-
...global.product.non_goals.map((item) => globalClaim(`non_goal.${item.key}`, "global_non_goal", "negative")),
|
|
46
|
-
...global.technical.constraints.map((item) => globalClaim(`constraint.${item.key}`, "global_constraint", "
|
|
47
|
-
...global.technical.forbidden_shortcuts.map((item) => globalClaim(`forbidden_shortcut.${item.key}`, "global_forbidden_shortcut", "negative")),
|
|
29
|
+
...global.product.non_goals.map((item) => globalClaim(`non_goal.${item.key}`, "global_non_goal", "negative", item.applicability_refs)),
|
|
30
|
+
...global.technical.constraints.map((item) => globalClaim(`constraint.${item.key}`, "global_constraint", "positive", item.applicability_refs)),
|
|
31
|
+
...global.technical.forbidden_shortcuts.map((item) => globalClaim(`forbidden_shortcut.${item.key}`, "global_forbidden_shortcut", "negative", item.applicability_refs)),
|
|
48
32
|
].sort((left, right) => left.id.localeCompare(right.id));
|
|
49
33
|
}
|
|
50
34
|
export function validateGlobalProofPolarity(claim, proof) {
|
|
51
|
-
if (
|
|
35
|
+
if (proof.polarity !== claim.required_polarity)
|
|
52
36
|
fail("global_negative_claim_proof_required", `${claim.local_key}:${proof.check_key}`);
|
|
53
37
|
}
|
|
54
38
|
export function validateProofSurface(claim, proof, outcomeKey) {
|
|
55
|
-
if (
|
|
56
|
-
proof.polarity
|
|
57
|
-
proof.polarity !== "counterfactual")
|
|
58
|
-
fail("negative_or_counterfactual_claim_proof_required", `${outcomeKey}:${claim.local_key}`);
|
|
39
|
+
if (proof.polarity !== claim.required_polarity)
|
|
40
|
+
fail("claim_proof_polarity_mismatch", `${outcomeKey}:${claim.local_key}:${proof.polarity}:${claim.required_polarity}`);
|
|
59
41
|
if ((claim.kind === "requirement" || claim.kind === "obligation") &&
|
|
60
42
|
claim.required_proof_surfaces.length > 0 &&
|
|
61
43
|
!claim.required_proof_surfaces.includes(proof.proof_surface))
|
|
@@ -69,20 +51,23 @@ export function assertAllGlobalClaimsCovered(uncovered) {
|
|
|
69
51
|
if (uncovered.length)
|
|
70
52
|
fail("global_claim_uncovered", uncovered.sort().join(","));
|
|
71
53
|
}
|
|
72
|
-
function claim(outcomeKey, localKey, kind, requiredProofSurfaces = []) {
|
|
54
|
+
function claim(outcomeKey, localKey, kind, requiredProofSurfaces = [], applicabilityRefs = [], requiredPolarity = "positive") {
|
|
73
55
|
return {
|
|
74
56
|
id: `${outcomeKey}.${localKey}`,
|
|
75
57
|
outcome_key: outcomeKey,
|
|
76
58
|
local_key: localKey,
|
|
77
59
|
kind,
|
|
78
60
|
required_proof_surfaces: requiredProofSurfaces,
|
|
61
|
+
required_polarity: requiredPolarity,
|
|
62
|
+
applicability_refs: applicabilityRefs,
|
|
79
63
|
};
|
|
80
64
|
}
|
|
81
|
-
function globalClaim(localKey, kind, requiredPolarity) {
|
|
65
|
+
function globalClaim(localKey, kind, requiredPolarity, applicabilityRefs) {
|
|
82
66
|
return {
|
|
83
67
|
id: `GLOBAL.${localKey}`,
|
|
84
68
|
local_key: localKey,
|
|
85
69
|
kind,
|
|
86
70
|
required_polarity: requiredPolarity,
|
|
71
|
+
applicability_refs: applicabilityRefs,
|
|
87
72
|
};
|
|
88
73
|
}
|