project-tiny-context-harness 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +394 -363
- package/assets/README.md +570 -514
- package/assets/README.zh-CN.md +331 -300
- package/assets/agents/.gitkeep +1 -1
- package/assets/agents/AGENTS_CORE.md +45 -25
- package/assets/context_templates/architecture.md +26 -25
- package/assets/context_templates/area.md +32 -31
- package/assets/context_templates/context.toml +30 -24
- 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 +31 -30
- 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 +155 -122
- 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 +99 -79
- package/assets/skills/context_surface_contract/SKILL.md +191 -191
- package/assets/skills/context_uiux_design/SKILL.md +171 -171
- package/assets/skills/design-resource-authoring/SKILL.md +86 -84
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +138 -123
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +132 -127
- package/assets/skills/design-resource-authoring/references/resource-selection.md +181 -154
- 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 +98 -92
- package/assets/skills/long-task-workflow/agents/openai.yaml +3 -1
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +72 -72
- package/assets/skills/long-task-workflow/references/contract-authoring.md +122 -101
- package/assets/skills/long-task-workflow/references/evidence-design.md +82 -61
- package/assets/skills/long-task-workflow/references/source-authoring.md +109 -90
- package/assets/skills/source-plan-authoring/SKILL.md +14 -14
- package/assets/tools/validate_context.py +442 -442
- package/dist/commands/long-task-authoring.js +27 -2
- package/dist/lib/context-default-footprint.js +2 -0
- package/dist/lib/context-manifest.js +6 -0
- package/dist/lib/context-templates.js +1 -1
- package/dist/lib/design-resource-fact-enums.d.ts +20 -0
- package/dist/lib/design-resource-fact-enums.js +170 -0
- package/dist/lib/design-resource-fact-locator-extractors.d.ts +8 -0
- package/dist/lib/design-resource-fact-locator-extractors.js +108 -0
- package/dist/lib/design-resource-fact-locator-resolver.d.ts +3 -0
- package/dist/lib/design-resource-fact-locator-resolver.js +112 -0
- package/dist/lib/design-resource-fact-locator-validation.d.ts +5 -0
- package/dist/lib/design-resource-fact-locator-validation.js +16 -0
- package/dist/lib/design-resource-fact-manifest-catalog.d.ts +4 -0
- package/dist/lib/design-resource-fact-manifest-catalog.js +249 -0
- package/dist/lib/design-resource-fact-manifest-model.d.ts +91 -0
- package/dist/lib/design-resource-fact-manifest-model.js +21 -0
- package/dist/lib/design-resource-fact-manifest-shape-axes.d.ts +6 -0
- package/dist/lib/design-resource-fact-manifest-shape-axes.js +159 -0
- package/dist/lib/design-resource-fact-manifest-shape-evidence.d.ts +4 -0
- package/dist/lib/design-resource-fact-manifest-shape-evidence.js +59 -0
- package/dist/lib/design-resource-fact-manifest-shape-facts.d.ts +4 -0
- package/dist/lib/design-resource-fact-manifest-shape-facts.js +109 -0
- package/dist/lib/design-resource-fact-manifest-shape-inspector.d.ts +5 -0
- package/dist/lib/design-resource-fact-manifest-shape-inspector.js +144 -0
- package/dist/lib/design-resource-fact-manifest-shape.d.ts +7 -0
- package/dist/lib/design-resource-fact-manifest-shape.js +75 -0
- package/dist/lib/design-resource-fact-manifest-types.d.ts +3 -0
- package/dist/lib/design-resource-fact-manifest-types.js +3 -0
- package/dist/lib/design-resource-fact-manifest-universe.d.ts +5 -0
- package/dist/lib/design-resource-fact-manifest-universe.js +50 -0
- package/dist/lib/design-resource-fact-manifest-validation.d.ts +3 -0
- package/dist/lib/design-resource-fact-manifest-validation.js +106 -0
- package/dist/lib/design-resource-fact-policy.d.ts +18 -0
- package/dist/lib/design-resource-fact-policy.js +72 -1
- package/dist/lib/design-resource-fact-property-methods.d.ts +3 -0
- package/dist/lib/design-resource-fact-property-methods.js +158 -0
- package/dist/lib/design-resource-fact-shape-primitives.d.ts +3 -0
- package/dist/lib/design-resource-fact-shape-primitives.js +18 -0
- package/dist/lib/design-resource-fact-types.d.ts +164 -0
- package/dist/lib/design-resource-fact-types.js +1 -0
- package/dist/lib/design-resource-fact-universe-assets.d.ts +4 -0
- package/dist/lib/design-resource-fact-universe-assets.js +71 -0
- package/dist/lib/design-resource-fact-universe-catalog.d.ts +4 -0
- package/dist/lib/design-resource-fact-universe-catalog.js +151 -0
- package/dist/lib/design-resource-fact-universe-conditions.d.ts +2 -0
- package/dist/lib/design-resource-fact-universe-conditions.js +92 -0
- package/dist/lib/design-resource-fact-universe-facts.d.ts +4 -0
- package/dist/lib/design-resource-fact-universe-facts.js +108 -0
- package/dist/lib/design-resource-fact-universe-helpers.d.ts +30 -0
- package/dist/lib/design-resource-fact-universe-helpers.js +167 -0
- package/dist/lib/design-resource-fact-universe-inspector.d.ts +7 -0
- package/dist/lib/design-resource-fact-universe-inspector.js +119 -0
- package/dist/lib/design-resource-fact-universe-proof.d.ts +4 -0
- package/dist/lib/design-resource-fact-universe-proof.js +113 -0
- package/dist/lib/design-resource-fact-universe-subjects.d.ts +5 -0
- package/dist/lib/design-resource-fact-universe-subjects.js +97 -0
- package/dist/lib/design-resource-fact-universe-variations.d.ts +2 -0
- package/dist/lib/design-resource-fact-universe-variations.js +75 -0
- package/dist/lib/design-resource-fact-value-validation.d.ts +2 -0
- package/dist/lib/design-resource-fact-value-validation.js +80 -0
- package/dist/lib/design-resource-handoff-file-primitives.js +2 -0
- package/dist/lib/design-resource-handoff-file-validation.js +13 -100
- package/dist/lib/design-resource-handoff-policy.d.ts +1 -0
- package/dist/lib/design-resource-handoff-policy.js +118 -11
- package/dist/lib/design-resource-handoff-shape-evidence.js +46 -3
- package/dist/lib/design-resource-handoff-shape-primitives.d.ts +5 -0
- package/dist/lib/design-resource-handoff-shape-primitives.js +28 -0
- package/dist/lib/design-resource-handoff-shape-structure.js +143 -22
- package/dist/lib/design-resource-handoff-shape.js +25 -0
- package/dist/lib/design-resource-handoff-types.d.ts +97 -21
- package/dist/lib/design-resource-handoff-types.js +22 -0
- package/dist/lib/design-resource-handoff-validation-coverage.d.ts +1 -1
- package/dist/lib/design-resource-handoff-validation-coverage.js +145 -118
- package/dist/lib/design-resource-handoff-validation-fact-cells.d.ts +2 -0
- package/dist/lib/design-resource-handoff-validation-fact-cells.js +60 -0
- package/dist/lib/design-resource-handoff-validation-fact-records.d.ts +2 -0
- package/dist/lib/design-resource-handoff-validation-fact-records.js +90 -0
- package/dist/lib/design-resource-handoff-validation-facts.js +10 -94
- package/dist/lib/design-resource-handoff-validation-proofs.d.ts +2 -0
- package/dist/lib/design-resource-handoff-validation-proofs.js +67 -0
- package/dist/lib/design-resource-handoff-validation-resource-closure.d.ts +3 -0
- package/dist/lib/design-resource-handoff-validation-resource-closure.js +88 -0
- package/dist/lib/design-resource-handoff-validation-structure.js +43 -14
- package/dist/lib/design-resource-handoff-validation.js +32 -0
- package/dist/lib/design-resource-handoff-web-dependency-validation.d.ts +2 -1
- package/dist/lib/design-resource-handoff-web-dependency-validation.js +67 -7
- package/dist/lib/execution-target-capabilities.d.ts +1 -1
- package/dist/lib/execution-target-capabilities.js +14 -0
- package/dist/lib/long-task-activation-validation.js +6 -2
- package/dist/lib/long-task-applicability-shape.js +3 -3
- package/dist/lib/long-task-authoring-authority-preview.js +1 -0
- package/dist/lib/long-task-authority-policy.d.ts +1 -0
- package/dist/lib/long-task-authority-policy.js +1 -0
- package/dist/lib/long-task-authority.js +13 -0
- package/dist/lib/long-task-claim-definitions.js +13 -1
- package/dist/lib/long-task-claims.js +23 -1
- package/dist/lib/long-task-contract-types.d.ts +3 -0
- package/dist/lib/long-task-delivery-compiler.js +1 -0
- package/dist/lib/long-task-delivery-parser.js +11 -1
- 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 +17 -0
- package/dist/lib/long-task-design-resource-handoff.js +62 -38
- package/dist/lib/long-task-design-target-capabilities.d.ts +14 -0
- package/dist/lib/long-task-design-target-capabilities.js +126 -0
- package/dist/lib/long-task-evidence-capability-codec.d.ts +94 -0
- package/dist/lib/long-task-evidence-capability-codec.js +395 -22
- package/dist/lib/long-task-evidence-capability-policy.js +18 -0
- package/dist/lib/long-task-evidence-capability-runtime.js +78 -0
- package/dist/lib/long-task-evidence-capability-types.d.ts +114 -1
- package/dist/lib/long-task-outcome-parser.js +4 -0
- package/dist/lib/long-task-playwright-capability-records.d.ts +5 -0
- package/dist/lib/long-task-playwright-capability-records.js +146 -0
- package/dist/lib/long-task-playwright-case-evidence.d.ts +3 -2
- package/dist/lib/long-task-playwright-case-evidence.js +10 -79
- package/dist/lib/long-task-playwright-case-primitives.d.ts +28 -0
- package/dist/lib/long-task-playwright-case-primitives.js +143 -0
- package/dist/lib/long-task-playwright-evidence.d.ts +1 -1
- package/dist/lib/long-task-playwright-evidence.js +10 -75
- package/dist/lib/long-task-runner-freeze.d.ts +2 -2
- package/dist/lib/long-task-runner-freeze.js +15 -1
- package/dist/lib/long-task-runtime-types.d.ts +4 -1
- package/dist/lib/long-task-semantic-contract-types.d.ts +1 -1
- package/dist/lib/long-task-semantic-drift-migration.js +2 -2
- package/dist/lib/long-task-semantic-fact-binding-types.d.ts +57 -0
- package/dist/lib/long-task-semantic-fact-binding-types.js +1 -0
- package/dist/lib/long-task-semantic-fact-closure-primitives.d.ts +5 -0
- package/dist/lib/long-task-semantic-fact-closure-primitives.js +43 -0
- package/dist/lib/long-task-semantic-fact-closure.d.ts +13 -0
- package/dist/lib/long-task-semantic-fact-closure.js +48 -0
- package/dist/lib/long-task-semantic-fact-contract-closure.d.ts +4 -0
- package/dist/lib/long-task-semantic-fact-contract-closure.js +24 -0
- package/dist/lib/long-task-semantic-fact-contract-facts.d.ts +4 -0
- package/dist/lib/long-task-semantic-fact-contract-facts.js +30 -0
- package/dist/lib/long-task-semantic-fact-contract-proofs.d.ts +4 -0
- package/dist/lib/long-task-semantic-fact-contract-proofs.js +97 -0
- package/dist/lib/long-task-semantic-fact-evidence.d.ts +21 -0
- package/dist/lib/long-task-semantic-fact-evidence.js +165 -0
- package/dist/lib/long-task-semantic-fact-input-closure.d.ts +4 -0
- package/dist/lib/long-task-semantic-fact-input-closure.js +101 -0
- package/dist/lib/long-task-semantic-fact-provenance-closure.d.ts +4 -0
- package/dist/lib/long-task-semantic-fact-provenance-closure.js +140 -0
- package/dist/lib/long-task-semantic-fact-shape.d.ts +3 -0
- package/dist/lib/long-task-semantic-fact-shape.js +89 -0
- package/dist/lib/long-task-semantic-fact-value-closure.d.ts +3 -0
- package/dist/lib/long-task-semantic-fact-value-closure.js +110 -0
- package/dist/lib/long-task-shape-primitives.d.ts +2 -1
- package/dist/lib/long-task-shape-primitives.js +7 -0
- package/dist/lib/long-task-source-item-parser.js +25 -6
- package/dist/lib/long-task-source-target-continuity.js +4 -1
- package/dist/lib/long-task-source-target-index.d.ts +1 -1
- package/dist/lib/long-task-source-target-index.js +5 -1
- package/dist/lib/long-task-ui-design-policy.js +8 -4
- package/dist/lib/long-task-ui-surface-shape.js +83 -1
- package/dist/lib/long-task-ui-surface-types.d.ts +29 -0
- package/dist/lib/modularity.js +7 -1
- package/dist/lib/semantic-fact-base-types.d.ts +14 -0
- package/dist/lib/semantic-fact-base-types.js +1 -0
- package/dist/lib/semantic-fact-catalog.d.ts +8 -0
- package/dist/lib/semantic-fact-catalog.js +191 -0
- package/dist/lib/semantic-fact-condition-shape.d.ts +48 -0
- package/dist/lib/semantic-fact-condition-shape.js +111 -0
- package/dist/lib/semantic-fact-input-shape.d.ts +34 -0
- package/dist/lib/semantic-fact-input-shape.js +111 -0
- package/dist/lib/semantic-fact-inventory-types.d.ts +147 -0
- package/dist/lib/semantic-fact-inventory-types.js +1 -0
- package/dist/lib/semantic-fact-manifest-shape.d.ts +4 -0
- package/dist/lib/semantic-fact-manifest-shape.js +135 -0
- package/dist/lib/semantic-fact-manifest-types.d.ts +58 -0
- package/dist/lib/semantic-fact-manifest-types.js +19 -0
- package/dist/lib/semantic-fact-policy-authority.d.ts +8 -0
- package/dist/lib/semantic-fact-policy-authority.js +79 -0
- package/dist/lib/semantic-fact-policy-census.d.ts +2 -0
- package/dist/lib/semantic-fact-policy-census.js +80 -0
- package/dist/lib/semantic-fact-policy-condition-references.d.ts +7 -0
- package/dist/lib/semantic-fact-policy-condition-references.js +19 -0
- package/dist/lib/semantic-fact-policy-conditions.d.ts +2 -0
- package/dist/lib/semantic-fact-policy-conditions.js +105 -0
- package/dist/lib/semantic-fact-policy-facts.d.ts +3 -0
- package/dist/lib/semantic-fact-policy-facts.js +73 -0
- package/dist/lib/semantic-fact-policy-primitives.d.ts +26 -0
- package/dist/lib/semantic-fact-policy-primitives.js +169 -0
- package/dist/lib/semantic-fact-policy-proofs.d.ts +2 -0
- package/dist/lib/semantic-fact-policy-proofs.js +75 -0
- package/dist/lib/semantic-fact-policy-properties.d.ts +3 -0
- package/dist/lib/semantic-fact-policy-properties.js +84 -0
- package/dist/lib/semantic-fact-policy-units.d.ts +4 -0
- package/dist/lib/semantic-fact-policy-units.js +103 -0
- package/dist/lib/semantic-fact-policy.d.ts +17 -0
- package/dist/lib/semantic-fact-policy.js +41 -0
- package/dist/lib/semantic-fact-proof-shape.d.ts +51 -0
- package/dist/lib/semantic-fact-proof-shape.js +121 -0
- package/dist/lib/semantic-fact-proof-types.d.ts +74 -0
- package/dist/lib/semantic-fact-proof-types.js +1 -0
- package/dist/lib/semantic-fact-property-shape.d.ts +29 -0
- package/dist/lib/semantic-fact-property-shape.js +77 -0
- package/dist/lib/semantic-fact-shape-constants.d.ts +3 -0
- package/dist/lib/semantic-fact-shape-constants.js +38 -0
- package/dist/lib/semantic-fact-shape-primitives.d.ts +15 -0
- package/dist/lib/semantic-fact-shape-primitives.js +68 -0
- package/dist/lib/semantic-fact-source-parser.d.ts +9 -0
- package/dist/lib/semantic-fact-source-parser.js +46 -0
- package/dist/lib/semantic-fact-support-shape.d.ts +21 -0
- package/dist/lib/semantic-fact-support-shape.js +59 -0
- package/dist/lib/semantic-fact-types.d.ts +5 -0
- package/dist/lib/semantic-fact-types.js +5 -0
- package/dist/lib/semantic-fact-unit-shape.d.ts +34 -0
- package/dist/lib/semantic-fact-unit-shape.js +89 -0
- package/dist/lib/semantic-fact-value-shape.d.ts +12 -0
- package/dist/lib/semantic-fact-value-shape.js +39 -0
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +1339 -131
- package/migrations/README.md +15 -15
- package/package.json +84 -84
- package/source-mappings.yaml +25 -25
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { SEMANTIC_FACT_DISPOSITIONS } from "./semantic-fact-shape-constants.js";
|
|
2
|
+
import { semanticArray, semanticLiteral, semanticObject, semanticStableRef, semanticStableRefs, semanticString, } from "./semantic-fact-shape-primitives.js";
|
|
3
|
+
import { parseSemanticFactAxisValues, parseSemanticFactBoolean, } from "./semantic-fact-value-shape.js";
|
|
4
|
+
export function parseSemanticFactAxisDispositions(value, label) {
|
|
5
|
+
return semanticArray(value, label).map((item, index) => {
|
|
6
|
+
const itemLabel = `${label}[${index}]`;
|
|
7
|
+
const row = semanticObject(item, itemLabel, [
|
|
8
|
+
"key",
|
|
9
|
+
"axis",
|
|
10
|
+
"standard",
|
|
11
|
+
"disposition",
|
|
12
|
+
"outcome_refs",
|
|
13
|
+
"values",
|
|
14
|
+
"source_item_refs",
|
|
15
|
+
"basis_refs",
|
|
16
|
+
"rationale",
|
|
17
|
+
]);
|
|
18
|
+
return {
|
|
19
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
20
|
+
axis: semanticStableRef(row.axis, `${itemLabel}.axis`),
|
|
21
|
+
standard: parseSemanticFactBoolean(row.standard, `${itemLabel}.standard`),
|
|
22
|
+
disposition: semanticLiteral(row.disposition, SEMANTIC_FACT_DISPOSITIONS, `${itemLabel}.disposition`),
|
|
23
|
+
outcome_refs: semanticStableRefs(row.outcome_refs, `${itemLabel}.outcome_refs`),
|
|
24
|
+
values: semanticArray(row.values, `${itemLabel}.values`).map((axisValue, axisIndex) => {
|
|
25
|
+
const axisLabel = `${itemLabel}.values[${axisIndex}]`;
|
|
26
|
+
const entry = semanticObject(axisValue, axisLabel, [
|
|
27
|
+
"key",
|
|
28
|
+
"source_item_refs",
|
|
29
|
+
"basis_refs",
|
|
30
|
+
]);
|
|
31
|
+
return {
|
|
32
|
+
key: semanticStableRef(entry.key, `${axisLabel}.key`),
|
|
33
|
+
source_item_refs: semanticStableRefs(entry.source_item_refs, `${axisLabel}.source_item_refs`),
|
|
34
|
+
basis_refs: semanticStableRefs(entry.basis_refs, `${axisLabel}.basis_refs`),
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
source_item_refs: semanticStableRefs(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
38
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
39
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function parseSemanticFactConditionRules(value, label) {
|
|
44
|
+
return semanticArray(value, label).map((item, index) => {
|
|
45
|
+
const itemLabel = `${label}[${index}]`;
|
|
46
|
+
const row = semanticObject(item, itemLabel, [
|
|
47
|
+
"key",
|
|
48
|
+
"outcome_ref",
|
|
49
|
+
"axis_refs",
|
|
50
|
+
"mode",
|
|
51
|
+
"condition_refs",
|
|
52
|
+
"exclusion_refs",
|
|
53
|
+
"source_item_refs",
|
|
54
|
+
"basis_refs",
|
|
55
|
+
"rationale",
|
|
56
|
+
]);
|
|
57
|
+
return {
|
|
58
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
59
|
+
outcome_ref: semanticStableRef(row.outcome_ref, `${itemLabel}.outcome_ref`),
|
|
60
|
+
axis_refs: semanticStableRefs(row.axis_refs, `${itemLabel}.axis_refs`),
|
|
61
|
+
mode: semanticLiteral(row.mode, ["independent", "cross_product", "explicit_meaningful"], `${itemLabel}.mode`),
|
|
62
|
+
condition_refs: semanticStableRefs(row.condition_refs, `${itemLabel}.condition_refs`),
|
|
63
|
+
exclusion_refs: semanticStableRefs(row.exclusion_refs, `${itemLabel}.exclusion_refs`),
|
|
64
|
+
source_item_refs: semanticStableRefs(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
65
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
66
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export function parseSemanticFactConditions(value, label) {
|
|
71
|
+
return semanticArray(value, label).map((item, index) => {
|
|
72
|
+
const itemLabel = `${label}[${index}]`;
|
|
73
|
+
const row = semanticObject(item, itemLabel, [
|
|
74
|
+
"key",
|
|
75
|
+
"outcome_ref",
|
|
76
|
+
"axis_values",
|
|
77
|
+
"source_item_refs",
|
|
78
|
+
"basis_refs",
|
|
79
|
+
]);
|
|
80
|
+
return {
|
|
81
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
82
|
+
outcome_ref: semanticStableRef(row.outcome_ref, `${itemLabel}.outcome_ref`),
|
|
83
|
+
axis_values: parseSemanticFactAxisValues(row.axis_values, `${itemLabel}.axis_values`),
|
|
84
|
+
source_item_refs: semanticStableRefs(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
85
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export function parseSemanticFactConditionExclusions(value, label) {
|
|
90
|
+
return semanticArray(value, label).map((item, index) => {
|
|
91
|
+
const itemLabel = `${label}[${index}]`;
|
|
92
|
+
const row = semanticObject(item, itemLabel, [
|
|
93
|
+
"key",
|
|
94
|
+
"outcome_ref",
|
|
95
|
+
"axis_values",
|
|
96
|
+
"disposition",
|
|
97
|
+
"source_item_refs",
|
|
98
|
+
"basis_refs",
|
|
99
|
+
"rationale",
|
|
100
|
+
]);
|
|
101
|
+
return {
|
|
102
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
103
|
+
outcome_ref: semanticStableRef(row.outcome_ref, `${itemLabel}.outcome_ref`),
|
|
104
|
+
axis_values: parseSemanticFactAxisValues(row.axis_values, `${itemLabel}.axis_values`),
|
|
105
|
+
disposition: semanticLiteral(row.disposition, ["not_applicable", "decision_required", "unavailable"], `${itemLabel}.disposition`),
|
|
106
|
+
source_item_refs: semanticStableRefs(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
107
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
108
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare function parseSemanticFactCensus(value: unknown, label: string): {
|
|
2
|
+
key: string;
|
|
3
|
+
kind: "axis" | "axis_value" | "blocker" | "condition" | "condition_rule" | "custom" | "environment" | "fact" | "fact_cell" | "family" | "input" | "oracle" | "population" | "proof_obligation" | "property" | "relation" | "scope_exclusion" | "subject";
|
|
4
|
+
locator: {
|
|
5
|
+
material_ref: string;
|
|
6
|
+
kind: "api_operation" | "code_symbol" | "custom" | "json_pointer" | "manifest_pointer" | "schema_pointer" | "source_item" | "whole_resource" | "yaml_pointer";
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
identity_sha256: string;
|
|
10
|
+
disposition: "material_with_facts" | "supporting_only";
|
|
11
|
+
fact_refs: string[];
|
|
12
|
+
basis_refs: string[];
|
|
13
|
+
rationale: string;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function parseSemanticFactInputs(value: unknown, label: string): {
|
|
16
|
+
key: string;
|
|
17
|
+
kind: "attachment" | "canonical_spec" | "context" | "delegated_instruction" | "design_resource" | "external_constraint" | "repository_preservation" | "source_item";
|
|
18
|
+
source_ref: string;
|
|
19
|
+
sha256: string;
|
|
20
|
+
disposition: "excluded_by_scope" | "non_ui_material" | "supporting_only" | "ui_design";
|
|
21
|
+
fact_refs: string[];
|
|
22
|
+
basis_refs: string[];
|
|
23
|
+
rationale: string;
|
|
24
|
+
}[];
|
|
25
|
+
export declare function parseSemanticFactFamilyDispositions(value: unknown, label: string): {
|
|
26
|
+
key: string;
|
|
27
|
+
family: string;
|
|
28
|
+
standard: boolean;
|
|
29
|
+
disposition: "applicable" | "decision_required" | "not_applicable" | "unavailable";
|
|
30
|
+
outcome_refs: string[];
|
|
31
|
+
source_item_refs: string[];
|
|
32
|
+
basis_refs: string[];
|
|
33
|
+
rationale: string;
|
|
34
|
+
}[];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { SEMANTIC_FACT_DISPOSITIONS } from "./semantic-fact-shape-constants.js";
|
|
2
|
+
import { semanticArray, semanticLiteral, semanticObject, semanticSha256, semanticStableRef, semanticStableRefs, semanticString, } from "./semantic-fact-shape-primitives.js";
|
|
3
|
+
import { parseSemanticFactBoolean, parseSemanticFactLocator, } from "./semantic-fact-value-shape.js";
|
|
4
|
+
export function parseSemanticFactCensus(value, label) {
|
|
5
|
+
return semanticArray(value, label).map((item, index) => {
|
|
6
|
+
const itemLabel = `${label}[${index}]`;
|
|
7
|
+
const row = semanticObject(item, itemLabel, [
|
|
8
|
+
"key",
|
|
9
|
+
"kind",
|
|
10
|
+
"locator",
|
|
11
|
+
"identity_sha256",
|
|
12
|
+
"disposition",
|
|
13
|
+
"fact_refs",
|
|
14
|
+
"basis_refs",
|
|
15
|
+
"rationale",
|
|
16
|
+
]);
|
|
17
|
+
return {
|
|
18
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
19
|
+
kind: semanticLiteral(row.kind, [
|
|
20
|
+
"input",
|
|
21
|
+
"scope_exclusion",
|
|
22
|
+
"family",
|
|
23
|
+
"subject",
|
|
24
|
+
"relation",
|
|
25
|
+
"population",
|
|
26
|
+
"axis",
|
|
27
|
+
"axis_value",
|
|
28
|
+
"condition_rule",
|
|
29
|
+
"condition",
|
|
30
|
+
"property",
|
|
31
|
+
"fact_cell",
|
|
32
|
+
"fact",
|
|
33
|
+
"proof_obligation",
|
|
34
|
+
"oracle",
|
|
35
|
+
"environment",
|
|
36
|
+
"blocker",
|
|
37
|
+
"custom",
|
|
38
|
+
], `${itemLabel}.kind`),
|
|
39
|
+
locator: parseSemanticFactLocator(row.locator, `${itemLabel}.locator`),
|
|
40
|
+
identity_sha256: semanticSha256(row.identity_sha256, `${itemLabel}.identity_sha256`),
|
|
41
|
+
disposition: semanticLiteral(row.disposition, ["material_with_facts", "supporting_only"], `${itemLabel}.disposition`),
|
|
42
|
+
fact_refs: semanticStableRefs(row.fact_refs, `${itemLabel}.fact_refs`),
|
|
43
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
44
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function parseSemanticFactInputs(value, label) {
|
|
49
|
+
return semanticArray(value, label).map((item, index) => {
|
|
50
|
+
const itemLabel = `${label}[${index}]`;
|
|
51
|
+
const row = semanticObject(item, itemLabel, [
|
|
52
|
+
"key",
|
|
53
|
+
"kind",
|
|
54
|
+
"source_ref",
|
|
55
|
+
"sha256",
|
|
56
|
+
"disposition",
|
|
57
|
+
"fact_refs",
|
|
58
|
+
"basis_refs",
|
|
59
|
+
"rationale",
|
|
60
|
+
]);
|
|
61
|
+
return {
|
|
62
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
63
|
+
kind: semanticLiteral(row.kind, [
|
|
64
|
+
"source_item",
|
|
65
|
+
"context",
|
|
66
|
+
"attachment",
|
|
67
|
+
"canonical_spec",
|
|
68
|
+
"repository_preservation",
|
|
69
|
+
"external_constraint",
|
|
70
|
+
"delegated_instruction",
|
|
71
|
+
"design_resource",
|
|
72
|
+
], `${itemLabel}.kind`),
|
|
73
|
+
source_ref: semanticString(row.source_ref, `${itemLabel}.source_ref`),
|
|
74
|
+
sha256: semanticSha256(row.sha256, `${itemLabel}.sha256`),
|
|
75
|
+
disposition: semanticLiteral(row.disposition, [
|
|
76
|
+
"non_ui_material",
|
|
77
|
+
"ui_design",
|
|
78
|
+
"supporting_only",
|
|
79
|
+
"excluded_by_scope",
|
|
80
|
+
], `${itemLabel}.disposition`),
|
|
81
|
+
fact_refs: semanticStableRefs(row.fact_refs, `${itemLabel}.fact_refs`),
|
|
82
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
83
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
export function parseSemanticFactFamilyDispositions(value, label) {
|
|
88
|
+
return semanticArray(value, label).map((item, index) => {
|
|
89
|
+
const itemLabel = `${label}[${index}]`;
|
|
90
|
+
const row = semanticObject(item, itemLabel, [
|
|
91
|
+
"key",
|
|
92
|
+
"family",
|
|
93
|
+
"standard",
|
|
94
|
+
"disposition",
|
|
95
|
+
"outcome_refs",
|
|
96
|
+
"source_item_refs",
|
|
97
|
+
"basis_refs",
|
|
98
|
+
"rationale",
|
|
99
|
+
]);
|
|
100
|
+
return {
|
|
101
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
102
|
+
family: semanticStableRef(row.family, `${itemLabel}.family`),
|
|
103
|
+
standard: parseSemanticFactBoolean(row.standard, `${itemLabel}.standard`),
|
|
104
|
+
disposition: semanticLiteral(row.disposition, SEMANTIC_FACT_DISPOSITIONS, `${itemLabel}.disposition`),
|
|
105
|
+
outcome_refs: semanticStableRefs(row.outcome_refs, `${itemLabel}.outcome_refs`),
|
|
106
|
+
source_item_refs: semanticStableRefs(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
107
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
108
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { EvidenceCapabilityV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import type { SemanticFactDisposition, SemanticFactLocatedValueV1, SemanticFactLocatorKind, SemanticFactValueKind } from "./semantic-fact-base-types.js";
|
|
3
|
+
export interface SemanticFactInputV1 {
|
|
4
|
+
key: string;
|
|
5
|
+
kind: "source_item" | "context" | "attachment" | "canonical_spec" | "repository_preservation" | "external_constraint" | "delegated_instruction" | "design_resource";
|
|
6
|
+
source_ref: string;
|
|
7
|
+
sha256: string;
|
|
8
|
+
disposition: "non_ui_material" | "ui_design" | "supporting_only" | "excluded_by_scope";
|
|
9
|
+
fact_refs: string[];
|
|
10
|
+
basis_refs: string[];
|
|
11
|
+
rationale: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SemanticFactCensusEntryV1 {
|
|
14
|
+
key: string;
|
|
15
|
+
kind: "input" | "scope_exclusion" | "family" | "subject" | "relation" | "population" | "axis" | "axis_value" | "condition_rule" | "condition" | "property" | "fact_cell" | "fact" | "proof_obligation" | "oracle" | "environment" | "blocker" | "custom";
|
|
16
|
+
locator: {
|
|
17
|
+
material_ref: string;
|
|
18
|
+
kind: SemanticFactLocatorKind;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
identity_sha256: string;
|
|
22
|
+
disposition: "material_with_facts" | "supporting_only";
|
|
23
|
+
fact_refs: string[];
|
|
24
|
+
basis_refs: string[];
|
|
25
|
+
rationale: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SemanticFactFamilyDispositionV1 {
|
|
28
|
+
key: string;
|
|
29
|
+
family: string;
|
|
30
|
+
standard: boolean;
|
|
31
|
+
disposition: SemanticFactDisposition;
|
|
32
|
+
outcome_refs: string[];
|
|
33
|
+
source_item_refs: string[];
|
|
34
|
+
basis_refs: string[];
|
|
35
|
+
rationale: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SemanticFactSubjectV1 {
|
|
38
|
+
key: string;
|
|
39
|
+
family_ref: string;
|
|
40
|
+
outcome_ref: string;
|
|
41
|
+
kind: string;
|
|
42
|
+
parent_ref: string | null;
|
|
43
|
+
owner_ref: string | null;
|
|
44
|
+
source_item_refs: string[];
|
|
45
|
+
basis_refs: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface SemanticFactRelationV1 {
|
|
48
|
+
key: string;
|
|
49
|
+
family_ref: string;
|
|
50
|
+
outcome_ref: string;
|
|
51
|
+
kind: string;
|
|
52
|
+
endpoints: Array<{
|
|
53
|
+
role: string;
|
|
54
|
+
unit_ref: string;
|
|
55
|
+
}>;
|
|
56
|
+
source_item_refs: string[];
|
|
57
|
+
basis_refs: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface SemanticFactPopulationV1 {
|
|
60
|
+
key: string;
|
|
61
|
+
family_ref: string;
|
|
62
|
+
outcome_ref: string;
|
|
63
|
+
kind: "static" | "dynamic";
|
|
64
|
+
member_unit_refs: string[];
|
|
65
|
+
universe: SemanticFactLocatedValueV1;
|
|
66
|
+
enumeration_rule: string;
|
|
67
|
+
exclusion_refs: string[];
|
|
68
|
+
source_item_refs: string[];
|
|
69
|
+
basis_refs: string[];
|
|
70
|
+
}
|
|
71
|
+
export interface SemanticFactAxisDispositionV1 {
|
|
72
|
+
key: string;
|
|
73
|
+
axis: string;
|
|
74
|
+
standard: boolean;
|
|
75
|
+
disposition: SemanticFactDisposition;
|
|
76
|
+
outcome_refs: string[];
|
|
77
|
+
values: Array<{
|
|
78
|
+
key: string;
|
|
79
|
+
source_item_refs: string[];
|
|
80
|
+
basis_refs: string[];
|
|
81
|
+
}>;
|
|
82
|
+
source_item_refs: string[];
|
|
83
|
+
basis_refs: string[];
|
|
84
|
+
rationale: string;
|
|
85
|
+
}
|
|
86
|
+
export interface SemanticFactConditionV1 {
|
|
87
|
+
key: string;
|
|
88
|
+
outcome_ref: string;
|
|
89
|
+
axis_values: Array<{
|
|
90
|
+
axis_ref: string;
|
|
91
|
+
value_ref: string;
|
|
92
|
+
}>;
|
|
93
|
+
source_item_refs: string[];
|
|
94
|
+
basis_refs: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface SemanticFactConditionExclusionV1 {
|
|
97
|
+
key: string;
|
|
98
|
+
outcome_ref: string;
|
|
99
|
+
axis_values: Array<{
|
|
100
|
+
axis_ref: string;
|
|
101
|
+
value_ref: string;
|
|
102
|
+
}>;
|
|
103
|
+
disposition: Exclude<SemanticFactDisposition, "applicable">;
|
|
104
|
+
source_item_refs: string[];
|
|
105
|
+
basis_refs: string[];
|
|
106
|
+
rationale: string;
|
|
107
|
+
}
|
|
108
|
+
export interface SemanticFactConditionRuleV1 {
|
|
109
|
+
key: string;
|
|
110
|
+
outcome_ref: string;
|
|
111
|
+
axis_refs: string[];
|
|
112
|
+
mode: "independent" | "cross_product" | "explicit_meaningful";
|
|
113
|
+
condition_refs: string[];
|
|
114
|
+
exclusion_refs: string[];
|
|
115
|
+
source_item_refs: string[];
|
|
116
|
+
basis_refs: string[];
|
|
117
|
+
rationale: string;
|
|
118
|
+
}
|
|
119
|
+
export interface SemanticFactPropertyDispositionV1 {
|
|
120
|
+
key: string;
|
|
121
|
+
family_ref: string;
|
|
122
|
+
property: string;
|
|
123
|
+
standard: boolean;
|
|
124
|
+
value_kind: SemanticFactValueKind;
|
|
125
|
+
required_methods: string[];
|
|
126
|
+
required_evidence_capabilities: EvidenceCapabilityV2[];
|
|
127
|
+
applicable_unit_refs: string[];
|
|
128
|
+
not_applicable_unit_refs: string[];
|
|
129
|
+
decision_required_unit_refs: string[];
|
|
130
|
+
unavailable_unit_refs: string[];
|
|
131
|
+
condition_refs: string[];
|
|
132
|
+
source_item_refs: string[];
|
|
133
|
+
basis_refs: string[];
|
|
134
|
+
rationale: string;
|
|
135
|
+
}
|
|
136
|
+
export interface SemanticFactCellV1 {
|
|
137
|
+
key: string;
|
|
138
|
+
outcome_ref: string;
|
|
139
|
+
unit_ref: string;
|
|
140
|
+
condition_ref: string;
|
|
141
|
+
property_ref: string;
|
|
142
|
+
disposition: "specified" | "not_applicable" | "decision_required" | "unavailable";
|
|
143
|
+
fact_ref: string | null;
|
|
144
|
+
source_item_refs: string[];
|
|
145
|
+
basis_refs: string[];
|
|
146
|
+
rationale: string;
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SemanticFactManifestV1 } from "./semantic-fact-types.js";
|
|
2
|
+
export { parseSemanticFactLocatedValue } from "./semantic-fact-value-shape.js";
|
|
3
|
+
export declare function parseSemanticFactManifestYaml(content: string): SemanticFactManifestV1;
|
|
4
|
+
export declare function parseSemanticFactManifestShape(value: unknown): SemanticFactManifestV1;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { parseSemanticFactAxisDispositions, parseSemanticFactConditionExclusions, parseSemanticFactConditionRules, parseSemanticFactConditions, } from "./semantic-fact-condition-shape.js";
|
|
2
|
+
import { parseSemanticFactCensus, parseSemanticFactFamilyDispositions, parseSemanticFactInputs, } from "./semantic-fact-input-shape.js";
|
|
3
|
+
import { SEMANTIC_FACT_MANIFEST_COLLECTIONS, } from "./semantic-fact-types.js";
|
|
4
|
+
import { parseSemanticFactCells, parseSemanticFactPropertyDispositions, } from "./semantic-fact-property-shape.js";
|
|
5
|
+
import { parseSemanticFactProofObligations, parseSemanticFacts, } from "./semantic-fact-proof-shape.js";
|
|
6
|
+
import { semanticArray, semanticInteger, semanticLiteral, semanticNullableSha256, semanticObject, semanticSha256, semanticStableRef, semanticStableRefs, semanticString, } from "./semantic-fact-shape-primitives.js";
|
|
7
|
+
import { parseSemanticFactBlockers, parseSemanticFactEnvironments, parseSemanticFactOracles, } from "./semantic-fact-support-shape.js";
|
|
8
|
+
import { parseSemanticFactPopulations, parseSemanticFactRelations, parseSemanticFactSubjects, } from "./semantic-fact-unit-shape.js";
|
|
9
|
+
import { parseStrictYaml } from "./strict-codec.js";
|
|
10
|
+
export { parseSemanticFactLocatedValue } from "./semantic-fact-value-shape.js";
|
|
11
|
+
export function parseSemanticFactManifestYaml(content) {
|
|
12
|
+
return parseSemanticFactManifestShape(parseStrictYaml(content));
|
|
13
|
+
}
|
|
14
|
+
export function parseSemanticFactManifestShape(value) {
|
|
15
|
+
const label = "semantic_fact_manifest";
|
|
16
|
+
const root = semanticObject(value, label, [
|
|
17
|
+
"schema_version",
|
|
18
|
+
"key",
|
|
19
|
+
"scope",
|
|
20
|
+
"inspector",
|
|
21
|
+
"generation",
|
|
22
|
+
"inputs",
|
|
23
|
+
"family_dispositions",
|
|
24
|
+
"subjects",
|
|
25
|
+
"relations",
|
|
26
|
+
"populations",
|
|
27
|
+
"axis_dispositions",
|
|
28
|
+
"condition_rules",
|
|
29
|
+
"conditions",
|
|
30
|
+
"condition_exclusions",
|
|
31
|
+
"property_dispositions",
|
|
32
|
+
"fact_cells",
|
|
33
|
+
"facts",
|
|
34
|
+
"proof_obligations",
|
|
35
|
+
"oracles",
|
|
36
|
+
"environments",
|
|
37
|
+
"blockers",
|
|
38
|
+
]);
|
|
39
|
+
const scope = semanticObject(root.scope, `${label}.scope`, [
|
|
40
|
+
"outcome_refs",
|
|
41
|
+
"source_item_refs",
|
|
42
|
+
"exclusions",
|
|
43
|
+
]);
|
|
44
|
+
const inspector = semanticObject(root.inspector, `${label}.inspector`, [
|
|
45
|
+
"trust",
|
|
46
|
+
"identity",
|
|
47
|
+
"version",
|
|
48
|
+
"implementation_sha256",
|
|
49
|
+
"capabilities",
|
|
50
|
+
"traversal",
|
|
51
|
+
"dynamic_discovery",
|
|
52
|
+
"census",
|
|
53
|
+
]);
|
|
54
|
+
const generation = semanticObject(root.generation, `${label}.generation`, [
|
|
55
|
+
"strategy",
|
|
56
|
+
"sampling",
|
|
57
|
+
"truncation",
|
|
58
|
+
"chunk_count",
|
|
59
|
+
"chunk_indexes",
|
|
60
|
+
"collections",
|
|
61
|
+
]);
|
|
62
|
+
return {
|
|
63
|
+
schema_version: semanticLiteral(root.schema_version, ["semantic-fact-manifest-v1"], `${label}.schema_version`),
|
|
64
|
+
key: semanticStableRef(root.key, `${label}.key`),
|
|
65
|
+
scope: {
|
|
66
|
+
outcome_refs: semanticStableRefs(scope.outcome_refs, `${label}.scope.outcome_refs`),
|
|
67
|
+
source_item_refs: semanticStableRefs(scope.source_item_refs, `${label}.scope.source_item_refs`),
|
|
68
|
+
exclusions: semanticArray(scope.exclusions, `${label}.scope.exclusions`).map((item, index) => {
|
|
69
|
+
const itemLabel = `${label}.scope.exclusions[${index}]`;
|
|
70
|
+
const row = semanticObject(item, itemLabel, [
|
|
71
|
+
"key",
|
|
72
|
+
"statement",
|
|
73
|
+
"affected_refs",
|
|
74
|
+
"source_item_refs",
|
|
75
|
+
"basis_refs",
|
|
76
|
+
"rationale",
|
|
77
|
+
]);
|
|
78
|
+
return {
|
|
79
|
+
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
80
|
+
statement: semanticString(row.statement, `${itemLabel}.statement`),
|
|
81
|
+
affected_refs: semanticStableRefs(row.affected_refs, `${itemLabel}.affected_refs`),
|
|
82
|
+
source_item_refs: semanticStableRefs(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
83
|
+
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
84
|
+
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
85
|
+
};
|
|
86
|
+
}),
|
|
87
|
+
},
|
|
88
|
+
inspector: {
|
|
89
|
+
trust: semanticLiteral(inspector.trust, ["frozen_executable", "named_external_tcb"], `${label}.inspector.trust`),
|
|
90
|
+
identity: semanticString(inspector.identity, `${label}.inspector.identity`),
|
|
91
|
+
version: semanticString(inspector.version, `${label}.inspector.version`),
|
|
92
|
+
implementation_sha256: semanticNullableSha256(inspector.implementation_sha256, `${label}.inspector.implementation_sha256`),
|
|
93
|
+
capabilities: semanticStableRefs(inspector.capabilities, `${label}.inspector.capabilities`),
|
|
94
|
+
traversal: semanticLiteral(inspector.traversal, ["complete_enumeration"], `${label}.inspector.traversal`),
|
|
95
|
+
dynamic_discovery: semanticLiteral(inspector.dynamic_discovery, ["fully_enumerated"], `${label}.inspector.dynamic_discovery`),
|
|
96
|
+
census: parseSemanticFactCensus(inspector.census, `${label}.inspector.census`),
|
|
97
|
+
},
|
|
98
|
+
generation: {
|
|
99
|
+
strategy: semanticLiteral(generation.strategy, ["complete_explicit"], `${label}.generation.strategy`),
|
|
100
|
+
sampling: semanticLiteral(generation.sampling, ["forbidden"], `${label}.generation.sampling`),
|
|
101
|
+
truncation: semanticLiteral(generation.truncation, ["forbidden"], `${label}.generation.truncation`),
|
|
102
|
+
chunk_count: semanticInteger(generation.chunk_count, `${label}.generation.chunk_count`, 1),
|
|
103
|
+
chunk_indexes: semanticArray(generation.chunk_indexes, `${label}.generation.chunk_indexes`).map((item, index) => semanticInteger(item, `${label}.generation.chunk_indexes[${index}]`, 0)),
|
|
104
|
+
collections: semanticArray(generation.collections, `${label}.generation.collections`).map((item, index) => {
|
|
105
|
+
const itemLabel = `${label}.generation.collections[${index}]`;
|
|
106
|
+
const row = semanticObject(item, itemLabel, [
|
|
107
|
+
"name",
|
|
108
|
+
"expected_count",
|
|
109
|
+
"identity_sha256",
|
|
110
|
+
]);
|
|
111
|
+
return {
|
|
112
|
+
name: semanticLiteral(row.name, SEMANTIC_FACT_MANIFEST_COLLECTIONS, `${itemLabel}.name`),
|
|
113
|
+
expected_count: semanticInteger(row.expected_count, `${itemLabel}.expected_count`),
|
|
114
|
+
identity_sha256: semanticSha256(row.identity_sha256, `${itemLabel}.identity_sha256`),
|
|
115
|
+
};
|
|
116
|
+
}),
|
|
117
|
+
},
|
|
118
|
+
inputs: parseSemanticFactInputs(root.inputs, `${label}.inputs`),
|
|
119
|
+
family_dispositions: parseSemanticFactFamilyDispositions(root.family_dispositions, `${label}.family_dispositions`),
|
|
120
|
+
subjects: parseSemanticFactSubjects(root.subjects, `${label}.subjects`),
|
|
121
|
+
relations: parseSemanticFactRelations(root.relations, `${label}.relations`),
|
|
122
|
+
populations: parseSemanticFactPopulations(root.populations, `${label}.populations`),
|
|
123
|
+
axis_dispositions: parseSemanticFactAxisDispositions(root.axis_dispositions, `${label}.axis_dispositions`),
|
|
124
|
+
condition_rules: parseSemanticFactConditionRules(root.condition_rules, `${label}.condition_rules`),
|
|
125
|
+
conditions: parseSemanticFactConditions(root.conditions, `${label}.conditions`),
|
|
126
|
+
condition_exclusions: parseSemanticFactConditionExclusions(root.condition_exclusions, `${label}.condition_exclusions`),
|
|
127
|
+
property_dispositions: parseSemanticFactPropertyDispositions(root.property_dispositions, `${label}.property_dispositions`),
|
|
128
|
+
fact_cells: parseSemanticFactCells(root.fact_cells, `${label}.fact_cells`),
|
|
129
|
+
facts: parseSemanticFacts(root.facts, `${label}.facts`),
|
|
130
|
+
proof_obligations: parseSemanticFactProofObligations(root.proof_obligations, `${label}.proof_obligations`),
|
|
131
|
+
oracles: parseSemanticFactOracles(root.oracles, `${label}.oracles`),
|
|
132
|
+
environments: parseSemanticFactEnvironments(root.environments, `${label}.environments`),
|
|
133
|
+
blockers: parseSemanticFactBlockers(root.blockers, `${label}.blockers`),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { SemanticFactAxisDispositionV1, SemanticFactCensusEntryV1, SemanticFactCellV1, SemanticFactConditionExclusionV1, SemanticFactConditionRuleV1, SemanticFactConditionV1, SemanticFactFamilyDispositionV1, SemanticFactInputV1, SemanticFactPopulationV1, SemanticFactPropertyDispositionV1, SemanticFactRelationV1, SemanticFactSubjectV1 } from "./semantic-fact-inventory-types.js";
|
|
2
|
+
import type { SemanticFactBlockerV1, SemanticFactEnvironmentV1, SemanticFactOracleV1, SemanticFactProofObligationV1, SemanticFactV1 } from "./semantic-fact-proof-types.js";
|
|
3
|
+
export declare const SEMANTIC_FACT_MANIFEST_COLLECTIONS: readonly ["inputs", "inspector_census", "family_dispositions", "subjects", "relations", "populations", "axis_dispositions", "condition_rules", "conditions", "condition_exclusions", "property_dispositions", "fact_cells", "facts", "proof_obligations", "oracles", "environments", "blockers"];
|
|
4
|
+
export type SemanticFactManifestCollectionName = (typeof SEMANTIC_FACT_MANIFEST_COLLECTIONS)[number];
|
|
5
|
+
export interface SemanticFactManifestV1 {
|
|
6
|
+
schema_version: "semantic-fact-manifest-v1";
|
|
7
|
+
key: string;
|
|
8
|
+
scope: {
|
|
9
|
+
outcome_refs: string[];
|
|
10
|
+
source_item_refs: string[];
|
|
11
|
+
exclusions: Array<{
|
|
12
|
+
key: string;
|
|
13
|
+
statement: string;
|
|
14
|
+
affected_refs: string[];
|
|
15
|
+
source_item_refs: string[];
|
|
16
|
+
basis_refs: string[];
|
|
17
|
+
rationale: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
inspector: {
|
|
21
|
+
trust: "frozen_executable" | "named_external_tcb";
|
|
22
|
+
identity: string;
|
|
23
|
+
version: string;
|
|
24
|
+
implementation_sha256: string | null;
|
|
25
|
+
capabilities: string[];
|
|
26
|
+
traversal: "complete_enumeration";
|
|
27
|
+
dynamic_discovery: "fully_enumerated";
|
|
28
|
+
census: SemanticFactCensusEntryV1[];
|
|
29
|
+
};
|
|
30
|
+
generation: {
|
|
31
|
+
strategy: "complete_explicit";
|
|
32
|
+
sampling: "forbidden";
|
|
33
|
+
truncation: "forbidden";
|
|
34
|
+
chunk_count: number;
|
|
35
|
+
chunk_indexes: number[];
|
|
36
|
+
collections: Array<{
|
|
37
|
+
name: SemanticFactManifestCollectionName;
|
|
38
|
+
expected_count: number;
|
|
39
|
+
identity_sha256: string;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
inputs: SemanticFactInputV1[];
|
|
43
|
+
family_dispositions: SemanticFactFamilyDispositionV1[];
|
|
44
|
+
subjects: SemanticFactSubjectV1[];
|
|
45
|
+
relations: SemanticFactRelationV1[];
|
|
46
|
+
populations: SemanticFactPopulationV1[];
|
|
47
|
+
axis_dispositions: SemanticFactAxisDispositionV1[];
|
|
48
|
+
condition_rules: SemanticFactConditionRuleV1[];
|
|
49
|
+
conditions: SemanticFactConditionV1[];
|
|
50
|
+
condition_exclusions: SemanticFactConditionExclusionV1[];
|
|
51
|
+
property_dispositions: SemanticFactPropertyDispositionV1[];
|
|
52
|
+
fact_cells: SemanticFactCellV1[];
|
|
53
|
+
facts: SemanticFactV1[];
|
|
54
|
+
proof_obligations: SemanticFactProofObligationV1[];
|
|
55
|
+
oracles: SemanticFactOracleV1[];
|
|
56
|
+
environments: SemanticFactEnvironmentV1[];
|
|
57
|
+
blockers: SemanticFactBlockerV1[];
|
|
58
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const SEMANTIC_FACT_MANIFEST_COLLECTIONS = [
|
|
2
|
+
"inputs",
|
|
3
|
+
"inspector_census",
|
|
4
|
+
"family_dispositions",
|
|
5
|
+
"subjects",
|
|
6
|
+
"relations",
|
|
7
|
+
"populations",
|
|
8
|
+
"axis_dispositions",
|
|
9
|
+
"condition_rules",
|
|
10
|
+
"conditions",
|
|
11
|
+
"condition_exclusions",
|
|
12
|
+
"property_dispositions",
|
|
13
|
+
"fact_cells",
|
|
14
|
+
"facts",
|
|
15
|
+
"proof_obligations",
|
|
16
|
+
"oracles",
|
|
17
|
+
"environments",
|
|
18
|
+
"blockers",
|
|
19
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SemanticFactManifestV1 } from "./semantic-fact-types.js";
|
|
2
|
+
export declare function validateSemanticFactInspector(manifest: SemanticFactManifestV1): void;
|
|
3
|
+
export declare function validateSemanticFactSourceLineage(manifest: SemanticFactManifestV1): void;
|
|
4
|
+
export declare function semanticFactCollectionIdentity(rows: Array<{
|
|
5
|
+
key: string;
|
|
6
|
+
}>): string;
|
|
7
|
+
export declare function validateSemanticFactUniqueIdentities(manifest: SemanticFactManifestV1): void;
|
|
8
|
+
export declare function validateSemanticFactGeneration(manifest: SemanticFactManifestV1): void;
|