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
|
@@ -69,6 +69,12 @@ export function key(value, label) {
|
|
|
69
69
|
fail(label, "must match ^[a-z0-9][a-z0-9-]*$");
|
|
70
70
|
return result;
|
|
71
71
|
}
|
|
72
|
+
export function semanticRef(value, label) {
|
|
73
|
+
const result = string(value, label);
|
|
74
|
+
if (!/^[a-z0-9][a-z0-9._:-]*$/u.test(result))
|
|
75
|
+
fail(label, "must be a stable lowercase semantic reference");
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
72
78
|
export function nullable(value, parser) {
|
|
73
79
|
return value === null ? null : parser(value);
|
|
74
80
|
}
|
|
@@ -100,6 +106,7 @@ export const EVIDENCE_CAPABILITIES = [
|
|
|
100
106
|
"visual_render",
|
|
101
107
|
"design_conformance",
|
|
102
108
|
"design_method",
|
|
109
|
+
"semantic_fact",
|
|
103
110
|
"target_runtime",
|
|
104
111
|
"input_variation",
|
|
105
112
|
];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { parseDesignResourceHandoffShape } from "./design-resource-handoff-shape.js";
|
|
2
|
+
import { parseSemanticFactManifestShape } from "./semantic-fact-manifest-shape.js";
|
|
2
3
|
import { normalizeSourceItemText, parseSourceBackgroundMarker, parseSourceItemStartMarker, SOURCE_BACKGROUND_END, SOURCE_BACKGROUND_START, SOURCE_ITEM_END, SOURCE_ITEM_START, validateSourceBackgroundLine, } from "./long-task-source-markers.js";
|
|
3
4
|
import { parseStrictYaml, sha256Hex } from "./strict-codec.js";
|
|
4
5
|
const DESIGN_RESOURCE_START = /^\s*```yaml[ \t]+design-resource-handoff-v1[ \t]*$/u;
|
|
6
|
+
const SEMANTIC_FACT_START = /^\s*```yaml[ \t]+semantic-fact-manifest-v1[ \t]*$/u;
|
|
5
7
|
const FORMAL_BLOCK_END = /^\s*```[ \t]*$/u;
|
|
6
8
|
export function parseSourceItems(sourcePath, content) {
|
|
7
9
|
const state = sourceParseState(sourcePath);
|
|
@@ -21,6 +23,7 @@ function sourceParseState(sourcePath) {
|
|
|
21
23
|
background: null,
|
|
22
24
|
formalBlock: null,
|
|
23
25
|
designResourceBlocks: 0,
|
|
26
|
+
semanticFactBlocks: 0,
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
29
|
function consumeSourceLine(state, line, lineNumber) {
|
|
@@ -42,7 +45,11 @@ function consumeOpenFormalBlock(state, line) {
|
|
|
42
45
|
return true;
|
|
43
46
|
}
|
|
44
47
|
try {
|
|
45
|
-
|
|
48
|
+
const value = parseStrictYaml(state.formalBlock.lines.join("\n"));
|
|
49
|
+
if (state.formalBlock.owner === "design-resource-handoff-v1")
|
|
50
|
+
parseDesignResourceHandoffShape(value);
|
|
51
|
+
else
|
|
52
|
+
parseSemanticFactManifestShape(value);
|
|
46
53
|
}
|
|
47
54
|
catch (error) {
|
|
48
55
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -52,14 +59,26 @@ function consumeOpenFormalBlock(state, line) {
|
|
|
52
59
|
return true;
|
|
53
60
|
}
|
|
54
61
|
function startFormalBlock(state, line, lineNumber) {
|
|
55
|
-
|
|
62
|
+
const owner = DESIGN_RESOURCE_START.test(line)
|
|
63
|
+
? "design-resource-handoff-v1"
|
|
64
|
+
: SEMANTIC_FACT_START.test(line)
|
|
65
|
+
? "semantic-fact-manifest-v1"
|
|
66
|
+
: null;
|
|
67
|
+
if (!owner)
|
|
56
68
|
return false;
|
|
57
69
|
assertNoOpenOwnedSection(state, lineNumber);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
if (owner === "design-resource-handoff-v1") {
|
|
71
|
+
state.designResourceBlocks += 1;
|
|
72
|
+
if (state.designResourceBlocks > 1)
|
|
73
|
+
throw new Error(`source_formal_block_duplicate:${state.sourcePath}:design-resource-handoff-v1`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
state.semanticFactBlocks += 1;
|
|
77
|
+
if (state.semanticFactBlocks > 1)
|
|
78
|
+
throw new Error(`source_formal_block_duplicate:${state.sourcePath}:semantic-fact-manifest-v1`);
|
|
79
|
+
}
|
|
61
80
|
state.formalBlock = {
|
|
62
|
-
owner
|
|
81
|
+
owner,
|
|
63
82
|
lines: [],
|
|
64
83
|
line: lineNumber,
|
|
65
84
|
};
|
|
@@ -32,7 +32,9 @@ function validateSourceClaimContinuity(claim, state, report) {
|
|
|
32
32
|
}
|
|
33
33
|
const ref = refs[0];
|
|
34
34
|
const target = state.targets.get(ref);
|
|
35
|
-
if (!target ||
|
|
35
|
+
if (!target ||
|
|
36
|
+
(target.kind !== "semantic_fact" &&
|
|
37
|
+
sourceKindForTarget(target) !== item.kind)) {
|
|
36
38
|
issue(report, `source_target_kind_mismatch:${claim.key}:${item.kind}:${target ? sourceKindForTarget(target) : "unknown"}:${ref}`);
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
@@ -63,6 +65,7 @@ function validateSourceClaimContinuity(claim, state, report) {
|
|
|
63
65
|
"technical_obligation",
|
|
64
66
|
"non_completing",
|
|
65
67
|
"forbidden_shortcut",
|
|
68
|
+
"semantic_fact",
|
|
66
69
|
].includes(target.kind))
|
|
67
70
|
state.sourceBackedOutcomeClaims.add(ref);
|
|
68
71
|
if (!target.outcome_key &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DeliveryContractV2, SourceItemKind } from "./long-task-delivery-types.js";
|
|
2
2
|
export interface CanonicalSourceTarget {
|
|
3
3
|
ref: string;
|
|
4
|
-
kind: "outcome_result" | "requirement" | "control" | "technical_obligation" | "non_completing" | "global_constraint" | "non_goal" | "forbidden_shortcut" | "acceptance" | "risk_fact" | "external_confirmation";
|
|
4
|
+
kind: "outcome_result" | "requirement" | "control" | "technical_obligation" | "non_completing" | "global_constraint" | "non_goal" | "forbidden_shortcut" | "acceptance" | "semantic_fact" | "risk_fact" | "external_confirmation";
|
|
5
5
|
normalized_text?: string;
|
|
6
6
|
scope?: "global" | "outcome";
|
|
7
7
|
outcome_key?: string;
|
|
@@ -6,6 +6,8 @@ export function buildCanonicalSourceTargetIndex(contract) {
|
|
|
6
6
|
targets.push(target(`${outcome.key}.result`, "outcome_result", outcome.product.observable_result, outcome.key));
|
|
7
7
|
for (const requirement of outcome.product.requirements)
|
|
8
8
|
targets.push(target(`${outcome.key}.requirement.${requirement.key}`, "requirement", requirement.statement, outcome.key));
|
|
9
|
+
for (const binding of outcome.semantic_fact_bindings.facts)
|
|
10
|
+
targets.push(target(`${outcome.key}.${binding.claim_ref}`, "semantic_fact", undefined, outcome.key));
|
|
9
11
|
for (const control of outcome.product.controls)
|
|
10
12
|
for (const field of controlFieldFacts(control))
|
|
11
13
|
targets.push(target(`${outcome.key}.control.${control.key}.${field.claim_field}`, "control", field.statement, outcome.key));
|
|
@@ -64,5 +66,7 @@ function target(ref, kind, text, outcomeKey, scope) {
|
|
|
64
66
|
export function sourceKindForTarget(target) {
|
|
65
67
|
return target.kind === "global_constraint"
|
|
66
68
|
? "technical_obligation"
|
|
67
|
-
: target.kind
|
|
69
|
+
: target.kind === "semantic_fact"
|
|
70
|
+
? null
|
|
71
|
+
: target.kind;
|
|
68
72
|
}
|
|
@@ -19,7 +19,7 @@ function validateDesignTargets({ outcome, binding, outcomeClaims, checks, carrie
|
|
|
19
19
|
if (!target.verification_method_bindings.length)
|
|
20
20
|
issue(report, "ui_design_target_verification_methods_required", label);
|
|
21
21
|
const methodArtifactPaths = new Set();
|
|
22
|
-
const
|
|
22
|
+
const methodFactObligations = new Set();
|
|
23
23
|
for (const [name, values] of [
|
|
24
24
|
["source_paths", target.source_paths],
|
|
25
25
|
["condition_keys", target.condition_keys],
|
|
@@ -62,10 +62,14 @@ function validateDesignTargets({ outcome, binding, outcomeClaims, checks, carrie
|
|
|
62
62
|
issue(report, "ui_design_method_evidence_conditions_mismatch", `${label}:${methodBinding.method}`);
|
|
63
63
|
for (const artifact of methodBinding.evidence_artifacts) {
|
|
64
64
|
unique(artifact.fact_refs, "ui_design_method_fact_ref_duplicate", `${label}:${methodBinding.method}:${artifact.condition_key}`, report);
|
|
65
|
+
unique(artifact.fact_expectations.map((item) => item.fact_ref), "ui_design_method_fact_expectation_duplicate", `${label}:${methodBinding.method}:${artifact.condition_key}`, report);
|
|
66
|
+
if (!sameSet(artifact.fact_expectations.map((item) => item.fact_ref), artifact.fact_refs))
|
|
67
|
+
issue(report, "ui_design_method_fact_expectation_refs_mismatch", `${label}:${methodBinding.method}:${artifact.condition_key}`);
|
|
65
68
|
for (const factRef of artifact.fact_refs) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
const obligationIdentity = `${methodBinding.method}\0${artifact.condition_key}\0${factRef}`;
|
|
70
|
+
if (methodFactObligations.has(obligationIdentity))
|
|
71
|
+
issue(report, "ui_design_method_fact_obligation_reused", `${label}:${methodBinding.method}:${artifact.condition_key}:${factRef}`);
|
|
72
|
+
methodFactObligations.add(obligationIdentity);
|
|
69
73
|
}
|
|
70
74
|
for (const [kind, artifactPath] of [
|
|
71
75
|
["record", artifact.path],
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DESIGN_RESOURCE_VERIFICATION_METHODS } from "./design-resource-handoff-types.js";
|
|
2
|
+
import { DESIGN_RESOURCE_COMPARATORS } from "./design-resource-fact-manifest-types.js";
|
|
3
|
+
import { parseDesignResourceLocatedDigest } from "./design-resource-fact-shape-primitives.js";
|
|
2
4
|
import { EXECUTION_TARGET_CAPABILITIES } from "./execution-target-capabilities.js";
|
|
3
|
-
import { array, fail, key, literal, object, repositoryFile, repositoryFiles, string, strings, } from "./long-task-shape-primitives.js";
|
|
5
|
+
import { array, fail, key, literal, nullable, object, repositoryFile, repositoryFiles, string, strings, } from "./long-task-shape-primitives.js";
|
|
4
6
|
export function parseSurfaceBindings(value, label) {
|
|
5
7
|
return array(value, label).map((item, index) => {
|
|
6
8
|
const itemLabel = `${label}[${index}]`;
|
|
@@ -100,17 +102,85 @@ function parseVerificationMethodBindings(value, label) {
|
|
|
100
102
|
"path",
|
|
101
103
|
"observation_path",
|
|
102
104
|
"fact_refs",
|
|
105
|
+
"fact_expectations",
|
|
103
106
|
]);
|
|
104
107
|
return {
|
|
105
108
|
condition_key: key(entry.condition_key, `${artifactLabel}.condition_key`),
|
|
106
109
|
path: repositoryFile(entry.path, `${artifactLabel}.path`),
|
|
107
110
|
observation_path: repositoryFile(entry.observation_path, `${artifactLabel}.observation_path`),
|
|
108
111
|
fact_refs: designFactRefs(entry.fact_refs, `${artifactLabel}.fact_refs`),
|
|
112
|
+
fact_expectations: parseDesignFactExpectations(entry.fact_expectations, `${artifactLabel}.fact_expectations`),
|
|
109
113
|
};
|
|
110
114
|
}),
|
|
111
115
|
};
|
|
112
116
|
});
|
|
113
117
|
}
|
|
118
|
+
function parseDesignFactExpectations(value, label) {
|
|
119
|
+
return array(value, label).map((item, index) => {
|
|
120
|
+
const itemLabel = `${label}[${index}]`;
|
|
121
|
+
const row = object(item, itemLabel, [
|
|
122
|
+
"fact_ref",
|
|
123
|
+
"subject_ref",
|
|
124
|
+
"variation_ref",
|
|
125
|
+
"property_ref",
|
|
126
|
+
"observation_sensitivity",
|
|
127
|
+
"expected",
|
|
128
|
+
"comparison",
|
|
129
|
+
"oracle",
|
|
130
|
+
"environment",
|
|
131
|
+
]);
|
|
132
|
+
const comparison = object(row.comparison, `${itemLabel}.comparison`, [
|
|
133
|
+
"comparator",
|
|
134
|
+
"mode",
|
|
135
|
+
"parameters",
|
|
136
|
+
"tolerance",
|
|
137
|
+
"mask",
|
|
138
|
+
]);
|
|
139
|
+
const comparator = string(comparison.comparator, `${itemLabel}.comparison.comparator`);
|
|
140
|
+
if (!DESIGN_RESOURCE_COMPARATORS.includes(comparator) &&
|
|
141
|
+
!/^custom\.[a-z0-9][a-z0-9._-]*$/u.test(comparator))
|
|
142
|
+
fail(`${itemLabel}.comparison.comparator`, "must be a standard comparator or custom.*");
|
|
143
|
+
const oracle = object(row.oracle, `${itemLabel}.oracle`, [
|
|
144
|
+
"key",
|
|
145
|
+
"trust",
|
|
146
|
+
"identity",
|
|
147
|
+
"version",
|
|
148
|
+
"sha256",
|
|
149
|
+
]);
|
|
150
|
+
const environment = object(row.environment, `${itemLabel}.environment`, [
|
|
151
|
+
"key",
|
|
152
|
+
"identity",
|
|
153
|
+
"definition",
|
|
154
|
+
]);
|
|
155
|
+
return {
|
|
156
|
+
fact_ref: designFactRef(row.fact_ref, `${itemLabel}.fact_ref`),
|
|
157
|
+
subject_ref: designFactRef(row.subject_ref, `${itemLabel}.subject_ref`),
|
|
158
|
+
variation_ref: designFactRef(row.variation_ref, `${itemLabel}.variation_ref`),
|
|
159
|
+
property_ref: designFactRef(row.property_ref, `${itemLabel}.property_ref`),
|
|
160
|
+
observation_sensitivity: literal(row.observation_sensitivity, ["plain", "protected"], `${itemLabel}.observation_sensitivity`),
|
|
161
|
+
expected: parseDesignResourceLocatedDigest(row.expected, `${itemLabel}.expected`),
|
|
162
|
+
comparison: {
|
|
163
|
+
comparator,
|
|
164
|
+
mode: literal(comparison.mode, ["exact", "tolerance"], `${itemLabel}.comparison.mode`),
|
|
165
|
+
parameters: parseDesignResourceLocatedDigest(comparison.parameters, `${itemLabel}.comparison.parameters`),
|
|
166
|
+
tolerance: nullable(comparison.tolerance, (entry) => parseDesignResourceLocatedDigest(entry, `${itemLabel}.comparison.tolerance`)),
|
|
167
|
+
mask: nullable(comparison.mask, (entry) => parseDesignResourceLocatedDigest(entry, `${itemLabel}.comparison.mask`)),
|
|
168
|
+
},
|
|
169
|
+
oracle: {
|
|
170
|
+
key: designFactRef(oracle.key, `${itemLabel}.oracle.key`),
|
|
171
|
+
trust: literal(oracle.trust, ["frozen_executable", "named_external_tcb"], `${itemLabel}.oracle.trust`),
|
|
172
|
+
identity: string(oracle.identity, `${itemLabel}.oracle.identity`),
|
|
173
|
+
version: string(oracle.version, `${itemLabel}.oracle.version`),
|
|
174
|
+
sha256: nullable(oracle.sha256, (entry) => digest(entry, `${itemLabel}.oracle.sha256`)),
|
|
175
|
+
},
|
|
176
|
+
environment: {
|
|
177
|
+
key: designFactRef(environment.key, `${itemLabel}.environment.key`),
|
|
178
|
+
identity: string(environment.identity, `${itemLabel}.environment.identity`),
|
|
179
|
+
definition: parseDesignResourceLocatedDigest(environment.definition, `${itemLabel}.environment.definition`),
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
}
|
|
114
184
|
function keys(value, label) {
|
|
115
185
|
return array(value, label).map((item, index) => key(item, `${label}[${index}]`));
|
|
116
186
|
}
|
|
@@ -123,3 +193,15 @@ function designFactRefs(value, label) {
|
|
|
123
193
|
return result;
|
|
124
194
|
});
|
|
125
195
|
}
|
|
196
|
+
function designFactRef(value, label) {
|
|
197
|
+
const result = string(value, label);
|
|
198
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/u.test(result))
|
|
199
|
+
fail(label, "must match ^[a-z0-9][a-z0-9._-]*$");
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
202
|
+
function digest(value, label) {
|
|
203
|
+
const result = string(value, label);
|
|
204
|
+
if (!/^[a-f0-9]{64}$/u.test(result))
|
|
205
|
+
fail(label, "must be a lowercase SHA-256");
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import type { DesignResourceVerificationMethod } from "./design-resource-handoff-types.js";
|
|
2
|
+
import type { DesignResourceComparator, DesignResourceLocatedDigestV1 } from "./design-resource-fact-manifest-types.js";
|
|
2
3
|
import type { ExecutionTargetCapabilityV2 } from "./execution-target-capabilities.js";
|
|
3
4
|
export type DesignTargetInterpretationV2 = "exact_target" | "constraint";
|
|
5
|
+
export interface DeliveryDesignFactExpectationV2 {
|
|
6
|
+
fact_ref: string;
|
|
7
|
+
subject_ref: string;
|
|
8
|
+
variation_ref: string;
|
|
9
|
+
property_ref: string;
|
|
10
|
+
observation_sensitivity: "plain" | "protected";
|
|
11
|
+
expected: DesignResourceLocatedDigestV1;
|
|
12
|
+
comparison: {
|
|
13
|
+
comparator: DesignResourceComparator | string;
|
|
14
|
+
mode: "exact" | "tolerance";
|
|
15
|
+
parameters: DesignResourceLocatedDigestV1;
|
|
16
|
+
tolerance: DesignResourceLocatedDigestV1 | null;
|
|
17
|
+
mask: DesignResourceLocatedDigestV1 | null;
|
|
18
|
+
};
|
|
19
|
+
oracle: {
|
|
20
|
+
key: string;
|
|
21
|
+
trust: "frozen_executable" | "named_external_tcb";
|
|
22
|
+
identity: string;
|
|
23
|
+
version: string;
|
|
24
|
+
sha256: string | null;
|
|
25
|
+
};
|
|
26
|
+
environment: {
|
|
27
|
+
key: string;
|
|
28
|
+
identity: string;
|
|
29
|
+
definition: DesignResourceLocatedDigestV1;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
4
32
|
export interface DeliveryDesignVerificationBindingV2 {
|
|
5
33
|
method: DesignResourceVerificationMethod;
|
|
6
34
|
assertion_ref: string;
|
|
@@ -9,6 +37,7 @@ export interface DeliveryDesignVerificationBindingV2 {
|
|
|
9
37
|
path: string;
|
|
10
38
|
observation_path: string;
|
|
11
39
|
fact_refs: string[];
|
|
40
|
+
fact_expectations: DeliveryDesignFactExpectationV2[];
|
|
12
41
|
}>;
|
|
13
42
|
}
|
|
14
43
|
export interface DeliveryDesignTargetV2 {
|
package/dist/lib/modularity.js
CHANGED
|
@@ -57,7 +57,8 @@ export async function runModularityCheck(projectRoot, options) {
|
|
|
57
57
|
}
|
|
58
58
|
const files = [];
|
|
59
59
|
for (const relativePath of [...candidates].sort()) {
|
|
60
|
-
if (
|
|
60
|
+
if (isWorkflowAuthorityArtifact(relativePath) ||
|
|
61
|
+
!shouldIncludeCodeFile(relativePath)) {
|
|
61
62
|
continue;
|
|
62
63
|
}
|
|
63
64
|
const absolutePath = path.join(projectRoot, ...relativePath.split("/"));
|
|
@@ -103,6 +104,11 @@ export async function runModularityCheck(projectRoot, options) {
|
|
|
103
104
|
errors: [...configErrors, ...waiverErrors, ...waiverTargetErrors],
|
|
104
105
|
};
|
|
105
106
|
}
|
|
107
|
+
function isWorkflowAuthorityArtifact(relativePath) {
|
|
108
|
+
const normalized = toPosix(relativePath);
|
|
109
|
+
return (normalized.startsWith(".work_products/") &&
|
|
110
|
+
normalized.endsWith("/delivery-contract.yaml"));
|
|
111
|
+
}
|
|
106
112
|
function analyzeFile(content, limit, relativePath) {
|
|
107
113
|
const lines = countPhysicalLines(content);
|
|
108
114
|
const metrics = analyzeModularity(content, relativePath);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SemanticFactDisposition = "applicable" | "not_applicable" | "decision_required" | "unavailable";
|
|
2
|
+
export type SemanticFactAuthorityKind = "direct" | "logically_derived" | "explicitly_delegated" | "evidence_backed_preservation";
|
|
3
|
+
export type SemanticFactValueKind = "boolean" | "number" | "string" | "enum" | "set" | "ordered_list" | "object" | "schema" | "relation" | "decision_table" | "formula" | "range" | "duration" | "timestamp" | "rate" | "ratio" | "digest" | "trace" | "custom";
|
|
4
|
+
export type SemanticFactLocatorKind = "source_item" | "manifest_pointer" | "json_pointer" | "yaml_pointer" | "whole_resource" | "schema_pointer" | "api_operation" | "code_symbol" | "custom";
|
|
5
|
+
export interface SemanticFactLocatedValueV1 {
|
|
6
|
+
representation: "inline" | "located" | "digest_only";
|
|
7
|
+
locator: {
|
|
8
|
+
material_ref: string;
|
|
9
|
+
kind: SemanticFactLocatorKind;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
sha256: string;
|
|
13
|
+
value?: unknown;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SEMANTIC_FACT_STANDARD_FAMILIES: readonly ["goal_scope_glossary", "actor_role_tenant_entitlement", "business_rule_calculation", "data_model", "operation_workflow", "state_machine", "temporal_scheduling", "input_validation", "output_error", "api_protocol", "event_message_job", "persistence_cache_search", "transaction_consistency_concurrency_idempotency", "fault_degradation_recovery", "backup_restore_disaster_recovery", "configuration_feature_flag_secret", "compatibility_migration_rollout", "performance_capacity_cost", "reliability_slo", "security", "privacy", "safety_compliance", "observability", "deployment_topology", "external_integration", "notification_file_media", "localization", "commercial_billing", "hardware_sensor", "ai_ml", "architecture_ownership"];
|
|
2
|
+
export declare const SEMANTIC_FACT_STANDARD_CONDITION_AXES: readonly ["actor", "role", "tenant", "organization", "jurisdiction", "residency", "environment", "region", "zone", "platform", "device", "client_version", "api_version", "schema_version", "runtime_version", "feature", "cohort", "configuration", "entitlement", "permission", "consent", "session", "entity_state", "prior_state", "input_class", "boundary_case", "data_volume", "locale", "timezone", "clock", "concurrency", "repetition", "dependency_health", "connectivity", "failure_class", "retry_phase", "consistency", "freshness", "migration_phase", "rollout_phase", "topology", "threat", "operational_mode"];
|
|
3
|
+
export declare const SEMANTIC_FACT_REQUIRED_INSPECTOR_CAPABILITIES: readonly ["source_inventory", "context_inventory", "input_classification", "standard_catalog", "custom_domain_discovery", "subject_inventory", "relation_inventory", "population_inventory", "condition_axis_inventory", "condition_combination_inventory", "property_inventory", "fact_cell_inventory", "proof_obligation_inventory"];
|
|
4
|
+
export declare const SEMANTIC_FACT_PROOF_METHODS: readonly ["exact_value", "schema_contract", "decision_table", "formula_evaluation", "invariant", "transition_trace", "sequence_trace", "durable_roundtrip", "boundary_invocation", "external_side_effect", "population_set_equality", "concurrency_schedule", "idempotency_repetition", "fault_injection", "recovery_drill", "migration", "compatibility", "performance", "capacity", "security", "privacy", "audit", "observability", "deployment", "implementation_structure"];
|
|
5
|
+
export declare const SEMANTIC_FACT_COMPARATORS: readonly ["exact_value", "semantic_equal", "set_equal", "ordered_equal", "schema_compatible", "decision_table_complete", "numeric_tolerance", "range_contains", "trace_equal", "invariant_holds", "population_set_equal", "latency_budget", "capacity_budget", "security_policy", "privacy_policy", "custom"];
|
|
6
|
+
export declare const SEMANTIC_FACT_STANDARD_PROPERTIES: Readonly<Record<(typeof SEMANTIC_FACT_STANDARD_FAMILIES)[number], readonly string[]>>;
|
|
7
|
+
export declare function isCustomSemanticFactName(value: string): boolean;
|
|
8
|
+
export declare function isAtomicSemanticFactAtom(value: string): boolean;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
export const SEMANTIC_FACT_STANDARD_FAMILIES = [
|
|
2
|
+
"goal_scope_glossary",
|
|
3
|
+
"actor_role_tenant_entitlement",
|
|
4
|
+
"business_rule_calculation",
|
|
5
|
+
"data_model",
|
|
6
|
+
"operation_workflow",
|
|
7
|
+
"state_machine",
|
|
8
|
+
"temporal_scheduling",
|
|
9
|
+
"input_validation",
|
|
10
|
+
"output_error",
|
|
11
|
+
"api_protocol",
|
|
12
|
+
"event_message_job",
|
|
13
|
+
"persistence_cache_search",
|
|
14
|
+
"transaction_consistency_concurrency_idempotency",
|
|
15
|
+
"fault_degradation_recovery",
|
|
16
|
+
"backup_restore_disaster_recovery",
|
|
17
|
+
"configuration_feature_flag_secret",
|
|
18
|
+
"compatibility_migration_rollout",
|
|
19
|
+
"performance_capacity_cost",
|
|
20
|
+
"reliability_slo",
|
|
21
|
+
"security",
|
|
22
|
+
"privacy",
|
|
23
|
+
"safety_compliance",
|
|
24
|
+
"observability",
|
|
25
|
+
"deployment_topology",
|
|
26
|
+
"external_integration",
|
|
27
|
+
"notification_file_media",
|
|
28
|
+
"localization",
|
|
29
|
+
"commercial_billing",
|
|
30
|
+
"hardware_sensor",
|
|
31
|
+
"ai_ml",
|
|
32
|
+
"architecture_ownership",
|
|
33
|
+
];
|
|
34
|
+
export const SEMANTIC_FACT_STANDARD_CONDITION_AXES = [
|
|
35
|
+
"actor",
|
|
36
|
+
"role",
|
|
37
|
+
"tenant",
|
|
38
|
+
"organization",
|
|
39
|
+
"jurisdiction",
|
|
40
|
+
"residency",
|
|
41
|
+
"environment",
|
|
42
|
+
"region",
|
|
43
|
+
"zone",
|
|
44
|
+
"platform",
|
|
45
|
+
"device",
|
|
46
|
+
"client_version",
|
|
47
|
+
"api_version",
|
|
48
|
+
"schema_version",
|
|
49
|
+
"runtime_version",
|
|
50
|
+
"feature",
|
|
51
|
+
"cohort",
|
|
52
|
+
"configuration",
|
|
53
|
+
"entitlement",
|
|
54
|
+
"permission",
|
|
55
|
+
"consent",
|
|
56
|
+
"session",
|
|
57
|
+
"entity_state",
|
|
58
|
+
"prior_state",
|
|
59
|
+
"input_class",
|
|
60
|
+
"boundary_case",
|
|
61
|
+
"data_volume",
|
|
62
|
+
"locale",
|
|
63
|
+
"timezone",
|
|
64
|
+
"clock",
|
|
65
|
+
"concurrency",
|
|
66
|
+
"repetition",
|
|
67
|
+
"dependency_health",
|
|
68
|
+
"connectivity",
|
|
69
|
+
"failure_class",
|
|
70
|
+
"retry_phase",
|
|
71
|
+
"consistency",
|
|
72
|
+
"freshness",
|
|
73
|
+
"migration_phase",
|
|
74
|
+
"rollout_phase",
|
|
75
|
+
"topology",
|
|
76
|
+
"threat",
|
|
77
|
+
"operational_mode",
|
|
78
|
+
];
|
|
79
|
+
export const SEMANTIC_FACT_REQUIRED_INSPECTOR_CAPABILITIES = [
|
|
80
|
+
"source_inventory",
|
|
81
|
+
"context_inventory",
|
|
82
|
+
"input_classification",
|
|
83
|
+
"standard_catalog",
|
|
84
|
+
"custom_domain_discovery",
|
|
85
|
+
"subject_inventory",
|
|
86
|
+
"relation_inventory",
|
|
87
|
+
"population_inventory",
|
|
88
|
+
"condition_axis_inventory",
|
|
89
|
+
"condition_combination_inventory",
|
|
90
|
+
"property_inventory",
|
|
91
|
+
"fact_cell_inventory",
|
|
92
|
+
"proof_obligation_inventory",
|
|
93
|
+
];
|
|
94
|
+
export const SEMANTIC_FACT_PROOF_METHODS = [
|
|
95
|
+
"exact_value",
|
|
96
|
+
"schema_contract",
|
|
97
|
+
"decision_table",
|
|
98
|
+
"formula_evaluation",
|
|
99
|
+
"invariant",
|
|
100
|
+
"transition_trace",
|
|
101
|
+
"sequence_trace",
|
|
102
|
+
"durable_roundtrip",
|
|
103
|
+
"boundary_invocation",
|
|
104
|
+
"external_side_effect",
|
|
105
|
+
"population_set_equality",
|
|
106
|
+
"concurrency_schedule",
|
|
107
|
+
"idempotency_repetition",
|
|
108
|
+
"fault_injection",
|
|
109
|
+
"recovery_drill",
|
|
110
|
+
"migration",
|
|
111
|
+
"compatibility",
|
|
112
|
+
"performance",
|
|
113
|
+
"capacity",
|
|
114
|
+
"security",
|
|
115
|
+
"privacy",
|
|
116
|
+
"audit",
|
|
117
|
+
"observability",
|
|
118
|
+
"deployment",
|
|
119
|
+
"implementation_structure",
|
|
120
|
+
];
|
|
121
|
+
export const SEMANTIC_FACT_COMPARATORS = [
|
|
122
|
+
"exact_value",
|
|
123
|
+
"semantic_equal",
|
|
124
|
+
"set_equal",
|
|
125
|
+
"ordered_equal",
|
|
126
|
+
"schema_compatible",
|
|
127
|
+
"decision_table_complete",
|
|
128
|
+
"numeric_tolerance",
|
|
129
|
+
"range_contains",
|
|
130
|
+
"trace_equal",
|
|
131
|
+
"invariant_holds",
|
|
132
|
+
"population_set_equal",
|
|
133
|
+
"latency_budget",
|
|
134
|
+
"capacity_budget",
|
|
135
|
+
"security_policy",
|
|
136
|
+
"privacy_policy",
|
|
137
|
+
"custom",
|
|
138
|
+
];
|
|
139
|
+
export const SEMANTIC_FACT_STANDARD_PROPERTIES = {
|
|
140
|
+
goal_scope_glossary: "goal observable_outcome scope non_goal term_definition unit_definition invariant assumption priority acceptance_meaning normative_status decision_owner conflict_resolution".split(" "),
|
|
141
|
+
actor_role_tenant_entitlement: "identity eligibility visibility allowed_operation forbidden_operation delegation impersonation isolation_boundary ownership approval_owner escalation lifecycle".split(" "),
|
|
142
|
+
business_rule_calculation: "predicate input precedence decision_branch overlap_handling gap_handling output formula formula_version unit precision rounding threshold boundary_inclusivity cap floor exception effective_period audit_rationale".split(" "),
|
|
143
|
+
data_model: "identity type schema nullability requiredness default absence_semantics enum_domain uniqueness cardinality ownership provenance lineage mutability lifecycle unit precision scale rounding format encoding normalization ordering comparison invariant validation_boundary sensitivity retention serialization".split(" "),
|
|
144
|
+
operation_workflow: "trigger initiator target precondition input guard ordered_step state_transition synchronous_effect asynchronous_effect output postcondition partial_success cancellation replacement compensation feedback audit_event forbidden_effect".split(" "),
|
|
145
|
+
state_machine: "state initial_state terminal_state transition trigger guard action emitted_effect illegal_transition compound_state concurrent_state precedence reentry interruption cancellation timeout stale_handling conflict_handling recovery restoration archive_delete".split(" "),
|
|
146
|
+
temporal_scheduling: "clock_source monotonicity timezone calendar dst_gap dst_fold clock_skew timestamp effective_boundary expiry_boundary interval_inclusivity schedule recurrence grace_period debounce throttle ordering lateness timeout lease retry_timing test_clock".split(" "),
|
|
147
|
+
input_validation: "source type requiredness default absence_semantics accepted_range grammar unit encoding normalization canonicalization cross_field_rule validation_order validation_location duplicate_handling replay_handling size_limit rate_limit malformed_case adversarial_case error_identity feedback lossless_recovery".split(" "),
|
|
148
|
+
output_error: "schema ordering format provenance freshness pagination streaming success_variant empty_variant partial_variant stale_variant degraded_variant error_variant error_code retryability feedback correlation_identity redaction reconciliation recovery".split(" "),
|
|
149
|
+
api_protocol: "operation_identity transport authentication authorization parameter header request_body serialization content_negotiation response_variant error_variant status_code pagination filtering sorting idempotency rate_limit quota timeout retry callback_webhook version_negotiation deprecation compatibility".split(" "),
|
|
150
|
+
event_message_job: "producer consumer schema version partition_routing_key correlation causation ordering delivery_guarantee acknowledgement deduplication idempotency retry_backoff timeout dead_letter replay retention backpressure poison_message cancellation schedule observable_completion".split(" "),
|
|
151
|
+
persistence_cache_search: "canonical_owner schema key index query ordering transaction_boundary persistence eviction freshness invalidation replication archive retention deletion tombstone import_export backup_participation tokenization ranking filter pagination rebuild reconciliation".split(" "),
|
|
152
|
+
transaction_consistency_concurrency_idempotency: "atomicity isolation consistency_model durability read_visibility write_visibility lock_lease optimistic_conflict pessimistic_conflict race_interleaving ordering causality duplicate_handling replay_handling idempotency_scope idempotency_key_lifetime retry_safety lost_update_prevention partial_commit compensation convergence".split(" "),
|
|
153
|
+
fault_degradation_recovery: "fault_class detection timeout_budget retry_eligibility retry_schedule jitter retry_exhaustion circuit_breaker bulkhead fallback degraded_result cancellation cleanup compensation feedback recovery_trigger restoration_point reconciliation data_loss_prevention duplicate_effect_prevention".split(" "),
|
|
154
|
+
backup_restore_disaster_recovery: "backup_scope frequency consistency_point encryption retention restore_procedure restore_verification rpo rto regional_disaster dependency_disaster failover failback replay reconciliation ownership drill_evidence".split(" "),
|
|
155
|
+
configuration_feature_flag_secret: "schema type requiredness safe_default scope environment_precedence tenant_precedence override_rule conflict_rule validation reload_restart rollout cohort_assignment kill_switch expiry cleanup audit protected_representation rotation failure_behavior".split(" "),
|
|
156
|
+
compatibility_migration_rollout: "supported_version backward_compatibility forward_compatibility mixed_version migration backfill validation dual_read dual_write cutover canary phased_rollout downgrade rollback irreversible_boundary cleanup deprecation data_reconciliation failure_recovery".split(" "),
|
|
157
|
+
performance_capacity_cost: "journey workload_model dataset_cardinality payload concurrency warm_cold_state latency_percentile deadline throughput queue_limit backpressure_limit resource_budget saturation scaling cost_boundary quota_boundary benchmark_environment measurement_window statistical_method tolerance".split(" "),
|
|
158
|
+
reliability_slo: "service_indicator measurement_point population exclusion target window availability correctness durability freshness continuity error_budget dependency_assumption degraded_expectation alert_relationship recovery_response".split(" "),
|
|
159
|
+
security: "asset threat trust_boundary authentication identity_proofing authorization least_privilege tenant_isolation session_lifecycle token_lifecycle mfa account_recovery secret_rotation key_rotation transport_encryption at_rest_encryption integrity input_defense output_defense audit rate_limit abuse_case supply_chain_integrity vulnerability_handling incident_response".split(" "),
|
|
160
|
+
privacy: "classification purpose lawful_authority consent preference minimization collection sharing lineage processor residency retention access_right correction_right portability_right deletion_right derived_data_effect redaction pseudonymization logging_restriction incident_handling policy_version".split(" "),
|
|
161
|
+
safety_compliance: "hazard prohibited_outcome jurisdiction policy_version risk_control safe_state human_approval four_eyes irreversibility confirmation cancellation emergency_stop audit accountability expert_authority incident_escalation residual_risk".split(" "),
|
|
162
|
+
observability: "log metric trace audit_event dimension unit correlation causation sampling aggregation redaction retention ownership health readiness liveness alert_condition alert_threshold alert_window alert_deduplication alert_routing alert_escalation dashboard runbook_diagnosis runbook_mitigation runbook_recovery".split(" "),
|
|
163
|
+
deployment_topology: "environment region zone topology replica dependency_direction configuration_injection secret_injection artifact_identity artifact_provenance startup readiness liveness shutdown migration_order rollout rollback drain maintenance autoscaling health_probe operational_owner post_deploy_verification".split(" "),
|
|
164
|
+
external_integration: "provider_protocol_identity capability version authentication region data_boundary quota rate_limit license commercial_constraint request_contract callback_contract timeout retry idempotency outage degradation side_effect_observation reconciliation sandbox_production_difference external_confirmation".split(" "),
|
|
165
|
+
notification_file_media: "audience channel template localization trigger priority quiet_hours cadence deduplication delivery_receipt retry unsubscribe file_type mime size dimensions duration codec metadata scan_quarantine upload_resume transformation storage signed_access fallback deletion accessibility_alternative".split(" "),
|
|
166
|
+
localization: "locale fallback language script unicode_normalization encoding collation case_sensitivity accent_sensitivity segmentation plural_rule grammar_rule timezone calendar date_format number_format currency exchange_rate_source measurement_unit conversion decimal_precision rounding locale_invariant_identifier".split(" "),
|
|
167
|
+
commercial_billing: "product_plan entitlement price effective_version meter_source aggregation currency tax jurisdiction precision rounding proration discount quota invoice payment_state retry refund dispute idempotency reconciliation audit processor_confirmation".split(" "),
|
|
168
|
+
hardware_sensor: "model firmware capability_discovery permission unit range resolution calibration sampling orientation coordinate_frame latency buffering connectivity power thermal storage_limit disconnect degradation actuator_safety simulation_limit physical_confirmation".split(" "),
|
|
169
|
+
ai_ml: "model version prompt_contract tool_contract input_schema output_schema context_source grounding_source stochastic_control confidence abstention safety_boundary policy_boundary bias_criterion quality_criterion explainability human_review intervention evaluation_population tolerance reproducibility drift_monitoring fallback privacy latency quota cost".split(" "),
|
|
170
|
+
architecture_ownership: "owner source_of_truth extension_point dependency_direction interface input_boundary output_boundary state_boundary persistence_boundary lifecycle_boundary failure_boundary recovery compatibility migration selected_design rejected_alternative future_change_challenge technical_debt forbidden_bypass conformance_check".split(" "),
|
|
171
|
+
};
|
|
172
|
+
export function isCustomSemanticFactName(value) {
|
|
173
|
+
return /^custom\.[a-z0-9][a-z0-9._-]*$/u.test(value);
|
|
174
|
+
}
|
|
175
|
+
export function isAtomicSemanticFactAtom(value) {
|
|
176
|
+
const normalized = value.trim().toLowerCase();
|
|
177
|
+
const aggregateLabel = /^(?:all|any|every|multiple|various)[._:-].*(?:catalog|states?|modes?|variants?|cases?|values?|conditions?)$/u.test(normalized) || /^(?:all|any|every|multiple|various)[._:-]\d+[._:-]/u.test(normalized);
|
|
178
|
+
return (/^[a-z0-9][a-z0-9._:-]*$/u.test(value) &&
|
|
179
|
+
!aggregateLabel &&
|
|
180
|
+
![
|
|
181
|
+
"all",
|
|
182
|
+
"any",
|
|
183
|
+
"every",
|
|
184
|
+
"default",
|
|
185
|
+
"various",
|
|
186
|
+
"multiple",
|
|
187
|
+
"all-states",
|
|
188
|
+
"all_states",
|
|
189
|
+
"*",
|
|
190
|
+
].includes(normalized));
|
|
191
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare function parseSemanticFactAxisDispositions(value: unknown, label: string): {
|
|
2
|
+
key: string;
|
|
3
|
+
axis: string;
|
|
4
|
+
standard: boolean;
|
|
5
|
+
disposition: "applicable" | "decision_required" | "not_applicable" | "unavailable";
|
|
6
|
+
outcome_refs: string[];
|
|
7
|
+
values: {
|
|
8
|
+
key: string;
|
|
9
|
+
source_item_refs: string[];
|
|
10
|
+
basis_refs: string[];
|
|
11
|
+
}[];
|
|
12
|
+
source_item_refs: string[];
|
|
13
|
+
basis_refs: string[];
|
|
14
|
+
rationale: string;
|
|
15
|
+
}[];
|
|
16
|
+
export declare function parseSemanticFactConditionRules(value: unknown, label: string): {
|
|
17
|
+
key: string;
|
|
18
|
+
outcome_ref: string;
|
|
19
|
+
axis_refs: string[];
|
|
20
|
+
mode: "cross_product" | "explicit_meaningful" | "independent";
|
|
21
|
+
condition_refs: string[];
|
|
22
|
+
exclusion_refs: string[];
|
|
23
|
+
source_item_refs: string[];
|
|
24
|
+
basis_refs: string[];
|
|
25
|
+
rationale: string;
|
|
26
|
+
}[];
|
|
27
|
+
export declare function parseSemanticFactConditions(value: unknown, label: string): {
|
|
28
|
+
key: string;
|
|
29
|
+
outcome_ref: string;
|
|
30
|
+
axis_values: {
|
|
31
|
+
axis_ref: string;
|
|
32
|
+
value_ref: string;
|
|
33
|
+
}[];
|
|
34
|
+
source_item_refs: string[];
|
|
35
|
+
basis_refs: string[];
|
|
36
|
+
}[];
|
|
37
|
+
export declare function parseSemanticFactConditionExclusions(value: unknown, label: string): {
|
|
38
|
+
key: string;
|
|
39
|
+
outcome_ref: string;
|
|
40
|
+
axis_values: {
|
|
41
|
+
axis_ref: string;
|
|
42
|
+
value_ref: string;
|
|
43
|
+
}[];
|
|
44
|
+
disposition: "decision_required" | "not_applicable" | "unavailable";
|
|
45
|
+
source_item_refs: string[];
|
|
46
|
+
basis_refs: string[];
|
|
47
|
+
rationale: string;
|
|
48
|
+
}[];
|