project-tiny-context-harness 0.8.0 → 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/README.md +40 -32
- package/assets/README.md +141 -60
- package/assets/README.zh-CN.md +48 -40
- package/assets/agents/AGENTS_CORE.md +16 -12
- package/assets/context_templates/architecture.md +5 -5
- package/assets/context_templates/area.md +5 -5
- package/assets/context_templates/global.md +6 -6
- package/assets/context_templates/screen-contract.md +18 -18
- package/assets/github/harness.yml +2 -2
- package/assets/skills/context_development_engineer/SKILL.md +7 -5
- package/assets/skills/context_full_project_export/SKILL.md +42 -42
- package/assets/skills/context_uiux_design/SKILL.md +27 -13
- package/assets/skills/design-resource-authoring/SKILL.md +7 -7
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +12 -12
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +21 -21
- package/assets/skills/design-resource-authoring/references/resource-selection.md +3 -3
- package/assets/skills/long-task-workflow/SKILL.md +17 -17
- package/assets/skills/long-task-workflow/agents/openai.yaml +4 -4
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +11 -9
- package/assets/skills/long-task-workflow/references/contract-authoring.md +19 -15
- package/assets/skills/long-task-workflow/references/evidence-design.md +18 -17
- package/assets/skills/long-task-workflow/references/source-authoring.md +15 -12
- package/assets/skills/normal-long-task/SKILL.md +12 -12
- 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-md.js +5 -4
- package/dist/lib/design-resource-handoff-shape-evidence.js +3 -0
- package/dist/lib/design-resource-handoff-shape-primitives.js +1 -3
- 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/doctor.js +2 -2
- 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-sandbox.js +1 -2
- 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 +8 -8
- package/package.json +84 -84
|
@@ -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
|
}
|