project-tiny-context-harness 0.7.3 → 0.7.5

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.
Files changed (105) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +355 -343
  3. package/assets/README.md +539 -494
  4. package/assets/README.zh-CN.md +300 -273
  5. package/assets/agents/.gitkeep +1 -1
  6. package/assets/agents/AGENTS_CORE.md +55 -53
  7. package/assets/context_templates/architecture.md +33 -33
  8. package/assets/context_templates/area.md +39 -39
  9. package/assets/context_templates/context.toml +30 -30
  10. package/assets/context_templates/deployment.md +35 -35
  11. package/assets/context_templates/global.md +51 -51
  12. package/assets/context_templates/product-surface-contract.md +64 -57
  13. package/assets/context_templates/screen-contract.md +180 -0
  14. package/assets/context_templates/verification.md +32 -32
  15. package/assets/github/.gitkeep +1 -1
  16. package/assets/github/harness.yml +41 -41
  17. package/assets/make/.gitkeep +1 -1
  18. package/assets/make/ty-context.mk +48 -48
  19. package/assets/skills/context_development_engineer/SKILL.md +92 -90
  20. package/assets/skills/context_full_project_export/SKILL.md +70 -70
  21. package/assets/skills/context_harness_upgrade/SKILL.md +60 -60
  22. package/assets/skills/context_product_plan/SKILL.md +77 -76
  23. package/assets/skills/context_surface_contract/SKILL.md +177 -162
  24. package/assets/skills/context_uiux_design/SKILL.md +108 -91
  25. package/assets/skills/long-task-workflow/SKILL.md +83 -83
  26. package/assets/skills/long-task-workflow/agents/openai.yaml +4 -4
  27. package/assets/skills/long-task-workflow/references/authority-lifecycle.md +57 -53
  28. package/assets/skills/long-task-workflow/references/contract-authoring.md +95 -77
  29. package/assets/skills/long-task-workflow/references/evidence-design.md +71 -58
  30. package/assets/skills/normal-long-task/SKILL.md +12 -12
  31. package/assets/skills/source-plan-authoring/SKILL.md +293 -290
  32. package/dist/commands/long-task-authoring.js +25 -0
  33. package/dist/commands/long-task.js +3 -0
  34. package/dist/lib/design-md.d.ts +7 -0
  35. package/dist/lib/design-md.js +47 -6
  36. package/dist/lib/doctor.js +19 -4
  37. package/dist/lib/long-task-activation-validation.js +13 -2
  38. package/dist/lib/long-task-authoring-authority-preview.js +1 -0
  39. package/dist/lib/long-task-authority-material-diff.js +54 -0
  40. package/dist/lib/long-task-authority-materials.d.ts +2 -2
  41. package/dist/lib/long-task-authority-materials.js +20 -0
  42. package/dist/lib/long-task-authority-policy.d.ts +26 -0
  43. package/dist/lib/long-task-authority-policy.js +23 -0
  44. package/dist/lib/long-task-authority-revision-analysis.d.ts +33 -0
  45. package/dist/lib/long-task-authority-revision-analysis.js +91 -0
  46. package/dist/lib/long-task-authority-revision.js +93 -158
  47. package/dist/lib/long-task-authority-types.d.ts +21 -0
  48. package/dist/lib/long-task-authority.js +32 -3
  49. package/dist/lib/long-task-check-evidence-decoder.d.ts +2 -2
  50. package/dist/lib/long-task-check-evidence-decoder.js +11 -1
  51. package/dist/lib/long-task-check-execution-policy.d.ts +3 -0
  52. package/dist/lib/long-task-check-execution-policy.js +5 -0
  53. package/dist/lib/long-task-check-runner.js +2 -0
  54. package/dist/lib/long-task-check-shape.js +33 -3
  55. package/dist/lib/long-task-claim-definitions.js +14 -0
  56. package/dist/lib/long-task-conformance-policy.d.ts +5 -0
  57. package/dist/lib/long-task-conformance-policy.js +35 -0
  58. package/dist/lib/long-task-contract-types.d.ts +28 -4
  59. package/dist/lib/long-task-delivery-compiler.js +1 -0
  60. package/dist/lib/long-task-delivery-parser.js +5 -2
  61. package/dist/lib/long-task-delivery-types.d.ts +2 -0
  62. package/dist/lib/long-task-delivery-types.js +2 -0
  63. package/dist/lib/long-task-delivery-validation.js +11 -0
  64. package/dist/lib/long-task-evidence-capability-codec.d.ts +2 -0
  65. package/dist/lib/long-task-evidence-capability-codec.js +231 -0
  66. package/dist/lib/long-task-evidence-capability-policy.d.ts +8 -0
  67. package/dist/lib/long-task-evidence-capability-policy.js +147 -0
  68. package/dist/lib/long-task-evidence-capability-runtime.d.ts +2 -0
  69. package/dist/lib/long-task-evidence-capability-runtime.js +86 -0
  70. package/dist/lib/long-task-evidence-capability-types.d.ts +74 -0
  71. package/dist/lib/long-task-evidence-capability-types.js +1 -0
  72. package/dist/lib/long-task-evidence-findings.js +5 -1
  73. package/dist/lib/long-task-evidence-v2.js +38 -23
  74. package/dist/lib/long-task-final-v2.js +42 -1
  75. package/dist/lib/long-task-outcome-parser.js +14 -3
  76. package/dist/lib/long-task-playwright-evidence.d.ts +2 -1
  77. package/dist/lib/long-task-playwright-evidence.js +70 -2
  78. package/dist/lib/long-task-product-shape.js +28 -0
  79. package/dist/lib/long-task-progress.js +4 -0
  80. package/dist/lib/long-task-root-shape.d.ts +1 -0
  81. package/dist/lib/long-task-root-shape.js +84 -3
  82. package/dist/lib/long-task-runner-environment.js +1 -1
  83. package/dist/lib/long-task-runner-freeze.d.ts +2 -2
  84. package/dist/lib/long-task-runner-freeze.js +3 -1
  85. package/dist/lib/long-task-runtime-types.d.ts +13 -0
  86. package/dist/lib/long-task-semantic-contract-types.d.ts +36 -0
  87. package/dist/lib/long-task-semantic-contract-types.js +1 -0
  88. package/dist/lib/long-task-semantic-drift-migration.d.ts +3 -0
  89. package/dist/lib/long-task-semantic-drift-migration.js +68 -0
  90. package/dist/lib/long-task-shape-primitives.d.ts +3 -0
  91. package/dist/lib/long-task-shape-primitives.js +25 -0
  92. package/dist/lib/long-task-source-target-index.js +14 -0
  93. package/dist/lib/long-task-stage-policy.d.ts +4 -0
  94. package/dist/lib/long-task-stage-policy.js +120 -0
  95. package/dist/lib/long-task-status-projection.d.ts +4 -1
  96. package/dist/lib/long-task-status-projection.js +63 -3
  97. package/dist/lib/long-task-status-v2.d.ts +11 -1
  98. package/dist/lib/long-task-status-v2.js +25 -3
  99. package/dist/lib/long-task-target-policy.d.ts +6 -0
  100. package/dist/lib/long-task-target-policy.js +127 -0
  101. package/dist/lib/migrations.js +29 -0
  102. package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +62 -8
  103. package/migrations/README.md +15 -8
  104. package/package.json +2 -2
  105. package/source-mappings.yaml +25 -25
@@ -28,6 +28,17 @@ task:
28
28
  id: replace-me
29
29
  title: Replace me
30
30
  goal: Describe the complete observable delivery goal.
31
+ target_profile:
32
+ key: replace-target
33
+ description: The declared product target is usable from its root entrypoint.
34
+ required_state: target_profile_usable
35
+ required_target_refs: [replace-runtime]
36
+ execution_targets:
37
+ - key: replace-runtime
38
+ description: The product runtime used by the acceptance oracle.
39
+ role: product
40
+ runtime_family: process
41
+ root_entrypoint: tests/replace-oracle.mjs
31
42
  source_paths: [plans/replace-me.md]
32
43
  context_refs: [project_context/areas/replace-me.md]
33
44
  source_claims:
@@ -37,14 +48,22 @@ source_claims:
37
48
  disposition:
38
49
  type: claim
39
50
  refs: [replace-outcome.requirement.replace-requirement]
51
+ stages:
52
+ - key: delivery
53
+ title: Delivery
54
+ depends_on: []
55
+ gate_outcome: replace-outcome
40
56
  risk:
41
57
  facts: {}
42
58
  global: {}
43
59
  outcomes:
44
60
  - key: replace-outcome
45
61
  title: Replace outcome
62
+ stage: delivery
46
63
  product:
47
64
  observable_result: Describe what a user or system can observe.
65
+ success_path_required: true
66
+ degradation_path_required: false
48
67
  owner:
49
68
  label: replace-owner
50
69
  context_refs: [project_context/areas/replace-me.md]
@@ -64,6 +83,11 @@ outcomes:
64
83
  acceptance:
65
84
  checks:
66
85
  - key: replace-check
86
+ journey_roles: [success, stage_gate]
87
+ execution_target: {target_ref: replace-runtime, entrypoint: root}
88
+ scenario:
89
+ given: [{key: source-ready, statement: The planned source carrier is available.}]
90
+ when: [{key: inspect-result, statement: Inspect the product result through the declared runtime.}]
67
91
  proof_surface: runtime_behavior
68
92
  runner:
69
93
  type: node_oracle
@@ -77,6 +101,7 @@ outcomes:
77
101
  criterion: The declared outcome and requirement are observable.
78
102
  claims: [result, requirement.replace-requirement]
79
103
  observation: result
104
+ evidence_capabilities: [state_delta, target_runtime]
80
105
  operator: equals
81
106
  expected: true
82
107
  counterfactual_controls:
@@ -68,6 +68,9 @@ export async function longTask(args) {
68
68
  workdir,
69
69
  workflow_status: result.workflow_status,
70
70
  external_confirmations: result.external_confirmations,
71
+ target_profile: result.target_profile,
72
+ target_state: result.target_state,
73
+ stage_results: result.stage_results,
71
74
  acceptance_scope: result.acceptance_scope,
72
75
  closed_scope: result.closed_scope,
73
76
  native_goal_effect: result.native_goal_effect,
@@ -1,5 +1,12 @@
1
1
  export declare const DESIGN_MD_PATH = "DESIGN.md";
2
2
  export declare const UNCONFIGURED_DESIGN_AUTHORITY_MARKER = "Design authority status: `unconfigured`";
3
3
  export type DesignAuthorityStatus = "missing" | "unconfigured" | "configured";
4
+ export interface DesignAuthorityInspection {
5
+ status: DesignAuthorityStatus;
6
+ has_authority_index: boolean;
7
+ token_source_selected: boolean;
8
+ classified_reference_count: number;
9
+ }
4
10
  export declare function createDesignMdIfMissing(projectRoot: string): Promise<boolean>;
5
11
  export declare function inspectDesignAuthorityStatus(projectRoot: string): Promise<DesignAuthorityStatus>;
12
+ export declare function inspectDesignAuthority(projectRoot: string): Promise<DesignAuthorityInspection>;
@@ -10,16 +10,57 @@ export async function createDesignMdIfMissing(projectRoot) {
10
10
  return writeTextIfChanged(target, designMdTemplate());
11
11
  }
12
12
  export async function inspectDesignAuthorityStatus(projectRoot) {
13
+ return (await inspectDesignAuthority(projectRoot)).status;
14
+ }
15
+ export async function inspectDesignAuthority(projectRoot) {
13
16
  const target = path.join(projectRoot, DESIGN_MD_PATH);
14
- if (!(await pathExists(target)))
15
- return "missing";
16
- const content = await readText(target);
17
- if (content.includes(UNCONFIGURED_DESIGN_AUTHORITY_MARKER)) {
18
- return "unconfigured";
17
+ if (!(await pathExists(target))) {
18
+ return {
19
+ status: "missing",
20
+ has_authority_index: false,
21
+ token_source_selected: false,
22
+ classified_reference_count: 0,
23
+ };
19
24
  }
25
+ const content = await readText(target);
20
26
  const legacyStarter = content.includes('name: "Starter Design System"') &&
21
27
  content.includes('description: "Neutral baseline design guidance for projects that have not defined their own visual system."');
22
- return legacyStarter ? "unconfigured" : "configured";
28
+ const status = content.includes(UNCONFIGURED_DESIGN_AUTHORITY_MARKER) || legacyStarter
29
+ ? "unconfigured"
30
+ : "configured";
31
+ const index = designAuthorityIndex(content);
32
+ return {
33
+ status,
34
+ has_authority_index: index !== null,
35
+ token_source_selected: index ? tokenSourceSelected(index) : false,
36
+ classified_reference_count: index ? classifiedReferenceCount(index) : 0,
37
+ };
38
+ }
39
+ function designAuthorityIndex(content) {
40
+ const match = /^###\s+Design Authority Index\s*$/imu.exec(content);
41
+ if (!match)
42
+ return null;
43
+ const remainder = content.slice(match.index + match[0].length);
44
+ const nextSection = /^#{1,3}\s+/mu.exec(remainder);
45
+ return nextSection ? remainder.slice(0, nextSection.index) : remainder;
46
+ }
47
+ function tokenSourceSelected(index) {
48
+ const line = index
49
+ .split(/\r?\n/u)
50
+ .find((candidate) => /authored(?: exact-value)? token source\s*:/iu.test(candidate));
51
+ if (!line)
52
+ return false;
53
+ const value = line.slice(line.indexOf(":") + 1).trim();
54
+ return (value.length > 0 &&
55
+ !/(?:not selected|unselected|none|n\/a|tbd|todo|unknown)/iu.test(value));
56
+ }
57
+ function classifiedReferenceCount(index) {
58
+ return index.split(/\r?\n/u).filter((line) => {
59
+ if (/(?:none|not) selected/iu.test(line))
60
+ return false;
61
+ const matches = line.match(/\b(?:exact-target|constraint|inspiration)\b/giu);
62
+ return matches?.length === 1;
63
+ }).length;
23
64
  }
24
65
  function designMdTemplate() {
25
66
  return [
@@ -4,7 +4,7 @@ import os from "node:os";
4
4
  import { readdir } from "node:fs/promises";
5
5
  import { DEFAULT_CONTEXT_FILE_SOFT_BUDGET_BYTES, DEFAULT_CONTEXT_TOTAL_SOFT_BUDGET_BYTES, inspectDefaultContextFootprint, } from "./context-default-footprint.js";
6
6
  import { readConfig } from "./config.js";
7
- import { inspectDesignAuthorityStatus } from "./design-md.js";
7
+ import { inspectDesignAuthority } from "./design-md.js";
8
8
  import { harnessConfigPath, harnessRoot } from "./harness-root.js";
9
9
  import { pathExists } from "./fs.js";
10
10
  import { unsupportedSchemaMessage } from "./schema-guard.js";
@@ -63,13 +63,28 @@ export async function runDoctor(projectRoot) {
63
63
  catch (error) {
64
64
  report.warnings.push(`default Context footprint unavailable: ${error instanceof Error ? error.message : String(error)}`);
65
65
  }
66
- const designAuthority = await inspectDesignAuthorityStatus(projectRoot);
67
- if (designAuthority === "unconfigured") {
66
+ const designAuthority = await inspectDesignAuthority(projectRoot);
67
+ if (designAuthority.status === "unconfigured") {
68
68
  report.info.push("design authority: unconfigured; DESIGN.md is a starter scaffold and does not authorize material production UI until project-specific tokens and exact-target/constraint/inspiration references are selected");
69
69
  }
70
70
  else {
71
- report.info.push(`design authority: ${designAuthority}`);
71
+ report.info.push(`design authority: ${designAuthority.status}${designAuthority.status === "configured" ? "; project-level visual-system configuration only" : ""}`);
72
72
  }
73
+ if (designAuthority.status === "configured") {
74
+ report.info.push(`design authority signals: index=${designAuthority.has_authority_index ? "present" : "missing"}, token_source=${designAuthority.token_source_selected ? "selected" : "missing-or-unselected"}, classified_references=${designAuthority.classified_reference_count}`);
75
+ if (!designAuthority.has_authority_index) {
76
+ report.warnings.push("configured DESIGN.md has no Design Authority Index; add the authored token source/generation direction and classified exact-target/constraint/inspiration references when material UI depends on them");
77
+ }
78
+ else {
79
+ if (!designAuthority.token_source_selected) {
80
+ report.warnings.push("Design Authority Index has no selected authored token source; generated tokens or current CSS must not become competing visual authority");
81
+ }
82
+ if (designAuthority.classified_reference_count === 0) {
83
+ report.warnings.push("Design Authority Index has no classified durable design references; inspiration, constraints and exact targets remain undeclared for material surfaces");
84
+ }
85
+ }
86
+ }
87
+ report.info.push("surface implementation readiness: not inferred; inspect owning Product Surface/Screen/Control Context, selected target or constraints, authored token source and project-owned verification for each material surface");
73
88
  for (const location of await findUserSuperpowersSkills()) {
74
89
  report.warnings.push(`user-level using-superpowers Skill detected at ${location}. Tiny Context workflows do not depend on it and doctor will not modify global configuration. To disable it explicitly for Codex, remove/disable that plugin or add a matching [[skills.config]] entry with enabled = false in ${path.join(os.homedir(), ".codex", "config.toml")}.`);
75
90
  }
@@ -3,6 +3,7 @@ import { addDiagnosticError } from "./long-task-authoring-preflight-diagnostics.
3
3
  import { compileProductClaimCoverage, } from "./long-task-claims.js";
4
4
  import { hashDeclaredFiles, validateCounterfactualPaths, validateTechnicalPaths, validateVerificationInputSeparation, } from "./long-task-delivery-preflight.js";
5
5
  import { validateClaimEvidenceSensitivity } from "./long-task-evidence-sensitivity-policy.js";
6
+ import { validateSemanticConformance } from "./long-task-conformance-policy.js";
6
7
  import { deliveryContractStructureDiagnostics, validateDeliveryContractStructure, } from "./long-task-delivery-validation.js";
7
8
  import { validateRawExecutionObservationOwnership } from "./long-task-observation-ownership.js";
8
9
  import { freezeDeliveryCheck } from "./long-task-runner-freeze.js";
@@ -56,7 +57,10 @@ export async function validateContractForActivation(options) {
56
57
  return emptyCompiledResult(claims, risk, sourceHashes, sourceItems, context);
57
58
  const globalChecks = [];
58
59
  for (const check of contract.global.acceptance.checks) {
59
- const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, null, repository, workspace), null, check.key);
60
+ const executionTarget = contract.task.execution_targets.find((target) => target.key === check.execution_target.target_ref);
61
+ if (!executionTarget)
62
+ continue;
63
+ const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, null, repository, workspace, executionTarget, contract.task.execution_targets), null, check.key);
60
64
  if (frozen)
61
65
  globalChecks.push(frozen);
62
66
  }
@@ -64,7 +68,10 @@ export async function validateContractForActivation(options) {
64
68
  for (const outcome of contract.outcomes) {
65
69
  const checks = [];
66
70
  for (const check of outcome.acceptance.checks) {
67
- const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, outcome.key, repository, workspace), outcome.key, check.key);
71
+ const executionTarget = contract.task.execution_targets.find((target) => target.key === check.execution_target.target_ref);
72
+ if (!executionTarget)
73
+ continue;
74
+ const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, outcome.key, repository, workspace, executionTarget, contract.task.execution_targets), outcome.key, check.key);
68
75
  if (frozen)
69
76
  checks.push(frozen);
70
77
  }
@@ -91,6 +98,10 @@ export async function validateContractForActivation(options) {
91
98
  await attempt(mode, diagnostics, () => validateClaimEvidenceSensitivity(contract, globalChecks, outcomes, mode === "collect"
92
99
  ? (error) => addDiagnosticError(diagnostics, new Error(error))
93
100
  : undefined));
101
+ if (risk)
102
+ await attempt(mode, diagnostics, () => validateSemanticConformance(contract, risk.effective_level, allChecks, mode === "collect"
103
+ ? (error) => addDiagnosticError(diagnostics, new Error(error))
104
+ : undefined));
94
105
  }
95
106
  return {
96
107
  claims,
@@ -33,6 +33,7 @@ export function authoringRevisionPreview(contract, sourceHashes, sourceItems, co
33
33
  schema_version: "long-task-delivery-v2",
34
34
  task: active.authority_snapshot.task,
35
35
  source_claims: active.authority_snapshot.source_claims,
36
+ stages: active.authority_snapshot.stages,
36
37
  risk: active.authority_snapshot.risk,
37
38
  global: active.authority_snapshot.global,
38
39
  outcomes: active.authority_snapshot.outcomes,
@@ -66,14 +66,28 @@ function productClaimSemantics(contract) {
66
66
  });
67
67
  for (const control of outcome.product.controls)
68
68
  for (const [field, value] of [
69
+ ["surface", control.surface],
70
+ ["region", control.region],
69
71
  ["location", control.location],
72
+ ["control_type", control.control_type],
73
+ ["label_content", control.label_content],
74
+ ["user_task", control.user_task],
75
+ ["visibility", control.visibility],
76
+ ["availability", control.availability],
70
77
  ["trigger", control.trigger],
71
78
  ["input", control.input],
79
+ ["validation", control.validation],
80
+ ["default_value", control.default_value],
81
+ ["interaction", control.interaction],
82
+ ["navigation_result", control.navigation_result],
72
83
  ["loading", control.loading_state],
73
84
  ["empty", control.empty_state],
74
85
  ["success", control.success_state],
75
86
  ["failure", control.failure_state],
87
+ ["recovery", control.recovery],
88
+ ["permission", control.permission],
76
89
  ["feedback", control.feedback],
90
+ ["accessibility", control.accessibility],
77
91
  ])
78
92
  if (value.trim())
79
93
  result.set(`${outcome.key}.control.${control.key}.${field}`, value);
@@ -89,13 +103,39 @@ function productClaimSemantics(contract) {
89
103
  function flattenProductSemantics(projection) {
90
104
  const fields = new Map([
91
105
  ["task.goal", projection.task_goal],
106
+ ["task.target_profile.key", projection.target_profile.key],
107
+ ["task.target_profile.description", projection.target_profile.description],
108
+ [
109
+ "task.target_profile.required_state",
110
+ projection.target_profile.required_state,
111
+ ],
112
+ [
113
+ "task.target_profile.required_target_refs",
114
+ [...projection.target_profile.required_target_refs].sort(),
115
+ ],
92
116
  ]);
117
+ for (const target of projection.execution_targets) {
118
+ const prefix = `task.execution_targets.${target.key}`;
119
+ fields.set(`${prefix}.description`, target.description);
120
+ fields.set(`${prefix}.role`, target.role);
121
+ fields.set(`${prefix}.runtime_family`, target.runtime_family);
122
+ fields.set(`${prefix}.root_entrypoint`, target.root_entrypoint);
123
+ }
124
+ for (const stage of projection.stages) {
125
+ const prefix = `stages.${stage.key}`;
126
+ fields.set(`${prefix}.title`, stage.title);
127
+ fields.set(`${prefix}.depends_on`, [...stage.depends_on].sort());
128
+ fields.set(`${prefix}.gate_outcome`, stage.gate_outcome);
129
+ }
93
130
  for (const item of projection.global_non_goals)
94
131
  fields.set(`global.product.non_goals.${item.key}`, item.statement);
95
132
  for (const outcome of projection.outcomes) {
96
133
  const prefix = `outcomes.${outcome.key}`;
97
134
  fields.set(`${prefix}.title`, outcome.title);
135
+ fields.set(`${prefix}.stage`, outcome.stage);
98
136
  fields.set(`${prefix}.observable_result`, outcome.observable_result);
137
+ fields.set(`${prefix}.success_path_required`, outcome.success_path_required);
138
+ fields.set(`${prefix}.degradation_path_required`, outcome.degradation_path_required);
99
139
  fields.set(`${prefix}.owner.label`, outcome.owner.label);
100
140
  fields.set(`${prefix}.owner.owner_surfaces`, outcome.owner.owner_surfaces);
101
141
  for (const requirement of outcome.requirements) {
@@ -104,14 +144,28 @@ function flattenProductSemantics(projection) {
104
144
  }
105
145
  for (const control of outcome.controls)
106
146
  for (const field of [
147
+ "surface",
148
+ "region",
107
149
  "location",
150
+ "control_type",
151
+ "label_content",
152
+ "user_task",
153
+ "visibility",
154
+ "availability",
108
155
  "trigger",
109
156
  "input",
157
+ "validation",
158
+ "default_value",
159
+ "interaction",
160
+ "navigation_result",
110
161
  "loading_state",
111
162
  "empty_state",
112
163
  "success_state",
113
164
  "failure_state",
165
+ "recovery",
166
+ "permission",
114
167
  "feedback",
168
+ "accessibility",
115
169
  ])
116
170
  fields.set(`${prefix}.controls.${control.key}.${field}`, control[field]);
117
171
  for (const item of outcome.non_completing_outcomes)
@@ -1,7 +1,7 @@
1
1
  import type { AuthorityMaterialHashesV2, CompiledDeliveryContractV2, CompiledSourceItemV2, ContextAuthoritySnapshotV2, DeliveryContractV2, GlobalSemanticProjectionV2, NextAuthorityMaterialsV2, ProductSemanticProjectionV2 } from "./long-task-delivery-types.js";
2
- export declare function computeAuthorityMaterials(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes">, sourceHashes: Record<string, string>, sourceItems: CompiledSourceItemV2[], contextSnapshot: ContextAuthoritySnapshotV2): NextAuthorityMaterialsV2;
2
+ export declare function computeAuthorityMaterials(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes" | "stages">, sourceHashes: Record<string, string>, sourceItems: CompiledSourceItemV2[], contextSnapshot: ContextAuthoritySnapshotV2): NextAuthorityMaterialsV2;
3
3
  export declare function compiledAuthorityMaterials(compiled: CompiledDeliveryContractV2): NextAuthorityMaterialsV2;
4
4
  export declare function authorityMaterialHashes(materials: NextAuthorityMaterialsV2): AuthorityMaterialHashesV2;
5
5
  export declare function authorityMaterialsChanged(previous: NextAuthorityMaterialsV2, next: NextAuthorityMaterialsV2): boolean;
6
- export declare function projectProductSemantics(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes">): ProductSemanticProjectionV2;
6
+ export declare function projectProductSemantics(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes" | "stages">): ProductSemanticProjectionV2;
7
7
  export declare function projectGlobalSemantics(contract: Pick<DeliveryContractV2, "global">): GlobalSemanticProjectionV2;
@@ -28,11 +28,17 @@ export function authorityMaterialsChanged(previous, next) {
28
28
  export function projectProductSemantics(contract) {
29
29
  return {
30
30
  task_goal: contract.task.goal,
31
+ target_profile: contract.task.target_profile,
32
+ execution_targets: [...contract.task.execution_targets].sort(keyOrder),
33
+ stages: [...contract.stages].sort(keyOrder),
31
34
  global_non_goals: keyedStatements(contract.global.product.non_goals),
32
35
  outcomes: [...contract.outcomes].sort(keyOrder).map((outcome) => ({
33
36
  key: outcome.key,
34
37
  title: outcome.title,
38
+ stage: outcome.stage,
35
39
  observable_result: outcome.product.observable_result,
40
+ success_path_required: outcome.product.success_path_required,
41
+ degradation_path_required: outcome.product.degradation_path_required,
36
42
  owner: {
37
43
  label: outcome.product.owner.label,
38
44
  owner_surfaces: [...outcome.product.owner_surfaces].sort(),
@@ -48,14 +54,28 @@ export function projectProductSemantics(contract) {
48
54
  })),
49
55
  controls: [...outcome.product.controls].sort(keyOrder).map((control) => ({
50
56
  key: control.key,
57
+ surface: control.surface,
58
+ region: control.region,
51
59
  location: control.location,
60
+ control_type: control.control_type,
61
+ label_content: control.label_content,
62
+ user_task: control.user_task,
63
+ visibility: control.visibility,
64
+ availability: control.availability,
52
65
  trigger: control.trigger,
53
66
  input: control.input,
67
+ validation: control.validation,
68
+ default_value: control.default_value,
69
+ interaction: control.interaction,
70
+ navigation_result: control.navigation_result,
54
71
  loading_state: control.loading_state,
55
72
  empty_state: control.empty_state,
56
73
  success_state: control.success_state,
57
74
  failure_state: control.failure_state,
75
+ recovery: control.recovery,
76
+ permission: control.permission,
58
77
  feedback: control.feedback,
78
+ accessibility: control.accessibility,
59
79
  })),
60
80
  non_completing_outcomes: keyedStatements(outcome.product.non_completing_outcomes),
61
81
  })),
@@ -1,6 +1,9 @@
1
1
  export type AuthorityFieldPolicy = "identity" | "semantic_user_review" | "proof_additive" | "runner_authority" | "input_coverage" | "output_requirement" | "scope" | "readiness_only" | "descriptive_non_authoritative";
2
2
  export declare const CHECK_AUTHORITY_POLICY: {
3
3
  key: "identity";
4
+ journey_roles: "proof_additive";
5
+ execution_target: "semantic_user_review";
6
+ scenario: "proof_additive";
4
7
  proof_surface: "semantic_user_review";
5
8
  runner: "runner_authority";
6
9
  verification_inputs: "proof_additive";
@@ -19,6 +22,8 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
19
22
  source_paths: "scope";
20
23
  context_refs: "scope";
21
24
  context_snapshot_mode: "scope";
25
+ target_profile: "semantic_user_review";
26
+ execution_targets: "semantic_user_review";
22
27
  };
23
28
  readonly source_claim: {
24
29
  key: "identity";
@@ -46,6 +51,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
46
51
  readonly outcome: {
47
52
  key: "identity";
48
53
  title: "descriptive_non_authoritative";
54
+ stage: "semantic_user_review";
49
55
  depends_on: "readiness_only";
50
56
  product: "semantic_user_review";
51
57
  technical: "semantic_user_review";
@@ -53,6 +59,8 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
53
59
  };
54
60
  readonly outcome_product: {
55
61
  observable_result: "semantic_user_review";
62
+ success_path_required: "semantic_user_review";
63
+ degradation_path_required: "semantic_user_review";
56
64
  owner: "semantic_user_review";
57
65
  requirements: "semantic_user_review";
58
66
  owner_surfaces: "semantic_user_review";
@@ -71,14 +79,28 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
71
79
  };
72
80
  readonly control: {
73
81
  key: "identity";
82
+ surface: "semantic_user_review";
83
+ region: "semantic_user_review";
74
84
  location: "semantic_user_review";
85
+ control_type: "semantic_user_review";
86
+ label_content: "semantic_user_review";
87
+ user_task: "semantic_user_review";
88
+ visibility: "semantic_user_review";
89
+ availability: "semantic_user_review";
75
90
  trigger: "semantic_user_review";
76
91
  input: "semantic_user_review";
92
+ validation: "semantic_user_review";
93
+ default_value: "semantic_user_review";
94
+ interaction: "semantic_user_review";
95
+ navigation_result: "semantic_user_review";
77
96
  loading_state: "semantic_user_review";
78
97
  empty_state: "semantic_user_review";
79
98
  success_state: "semantic_user_review";
80
99
  failure_state: "semantic_user_review";
100
+ recovery: "semantic_user_review";
101
+ permission: "semantic_user_review";
81
102
  feedback: "semantic_user_review";
103
+ accessibility: "semantic_user_review";
82
104
  };
83
105
  readonly outcome_technical: {
84
106
  obligations: "semantic_user_review";
@@ -114,6 +136,9 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
114
136
  };
115
137
  readonly check: {
116
138
  key: "identity";
139
+ journey_roles: "proof_additive";
140
+ execution_target: "semantic_user_review";
141
+ scenario: "proof_additive";
117
142
  proof_surface: "semantic_user_review";
118
143
  runner: "runner_authority";
119
144
  verification_inputs: "proof_additive";
@@ -129,6 +154,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
129
154
  criterion: "semantic_user_review";
130
155
  claims: "proof_additive";
131
156
  observation: "proof_additive";
157
+ evidence_capabilities: "proof_additive";
132
158
  operator: "proof_additive";
133
159
  expected: "proof_additive";
134
160
  };
@@ -5,6 +5,8 @@ const TASK_AUTHORITY_POLICY = {
5
5
  source_paths: "scope",
6
6
  context_refs: "scope",
7
7
  context_snapshot_mode: "scope",
8
+ target_profile: "semantic_user_review",
9
+ execution_targets: "semantic_user_review",
8
10
  };
9
11
  const SOURCE_CLAIM_AUTHORITY_POLICY = {
10
12
  key: "identity",
@@ -32,6 +34,7 @@ const GLOBAL_ACCEPTANCE_AUTHORITY_POLICY = {
32
34
  const OUTCOME_AUTHORITY_POLICY = {
33
35
  key: "identity",
34
36
  title: "descriptive_non_authoritative",
37
+ stage: "semantic_user_review",
35
38
  depends_on: "readiness_only",
36
39
  product: "semantic_user_review",
37
40
  technical: "semantic_user_review",
@@ -39,6 +42,8 @@ const OUTCOME_AUTHORITY_POLICY = {
39
42
  };
40
43
  const OUTCOME_PRODUCT_AUTHORITY_POLICY = {
41
44
  observable_result: "semantic_user_review",
45
+ success_path_required: "semantic_user_review",
46
+ degradation_path_required: "semantic_user_review",
42
47
  owner: "semantic_user_review",
43
48
  requirements: "semantic_user_review",
44
49
  owner_surfaces: "semantic_user_review",
@@ -57,14 +62,28 @@ const OWNER_AUTHORITY_POLICY = {
57
62
  };
58
63
  const CONTROL_AUTHORITY_POLICY = {
59
64
  key: "identity",
65
+ surface: "semantic_user_review",
66
+ region: "semantic_user_review",
60
67
  location: "semantic_user_review",
68
+ control_type: "semantic_user_review",
69
+ label_content: "semantic_user_review",
70
+ user_task: "semantic_user_review",
71
+ visibility: "semantic_user_review",
72
+ availability: "semantic_user_review",
61
73
  trigger: "semantic_user_review",
62
74
  input: "semantic_user_review",
75
+ validation: "semantic_user_review",
76
+ default_value: "semantic_user_review",
77
+ interaction: "semantic_user_review",
78
+ navigation_result: "semantic_user_review",
63
79
  loading_state: "semantic_user_review",
64
80
  empty_state: "semantic_user_review",
65
81
  success_state: "semantic_user_review",
66
82
  failure_state: "semantic_user_review",
83
+ recovery: "semantic_user_review",
84
+ permission: "semantic_user_review",
67
85
  feedback: "semantic_user_review",
86
+ accessibility: "semantic_user_review",
68
87
  };
69
88
  const OUTCOME_TECHNICAL_AUTHORITY_POLICY = {
70
89
  obligations: "semantic_user_review",
@@ -100,6 +119,9 @@ const OUTCOME_ACCEPTANCE_AUTHORITY_POLICY = {
100
119
  };
101
120
  export const CHECK_AUTHORITY_POLICY = {
102
121
  key: "identity",
122
+ journey_roles: "proof_additive",
123
+ execution_target: "semantic_user_review",
124
+ scenario: "proof_additive",
103
125
  proof_surface: "semantic_user_review",
104
126
  runner: "runner_authority",
105
127
  verification_inputs: "proof_additive",
@@ -115,6 +137,7 @@ const ASSERTION_AUTHORITY_POLICY = {
115
137
  criterion: "semantic_user_review",
116
138
  claims: "proof_additive",
117
139
  observation: "proof_additive",
140
+ evidence_capabilities: "proof_additive",
118
141
  operator: "proof_additive",
119
142
  expected: "proof_additive",
120
143
  };
@@ -0,0 +1,33 @@
1
+ import type { CompiledCheckV2, CompiledDeliveryContractV2, DeliveryContractV2 } from "./long-task-delivery-types.js";
2
+ export interface CheckRevisionAnalysis {
3
+ negative_assertions_removed: string[];
4
+ proof_surfaces_changed: string[];
5
+ runner_definitions_changed: string[];
6
+ verification_inputs_added: string[];
7
+ verification_inputs_removed_or_replaced: string[];
8
+ input_paths_added: string[];
9
+ input_paths_removed_or_narrowed: string[];
10
+ expected_output_paths_removed_or_weakened: string[];
11
+ artifacts_removed: string[];
12
+ environment_requirements_removed: string[];
13
+ }
14
+ export declare function analyzeCheckRevisions(beforeChecks: Map<string, CompiledCheckV2>, afterChecks: Map<string, CompiledCheckV2>): CheckRevisionAnalysis;
15
+ export interface OutcomeRevisionAnalysis {
16
+ owner_paths_expanded: string[];
17
+ owner_context_refs_removed: string[];
18
+ expected_change_paths_expanded: string[];
19
+ allowed_paths_expanded: string[];
20
+ forbidden_paths_removed: string[];
21
+ bindings_removed_or_expanded: string[];
22
+ obligations_removed_or_weakened: string[];
23
+ rollback_or_recovery_weakened: string[];
24
+ counterfactuals_removed: string[];
25
+ population_weakened: string[];
26
+ }
27
+ export declare function analyzeOutcomeRevisions(previous: CompiledDeliveryContractV2, next: DeliveryContractV2): OutcomeRevisionAnalysis;
28
+ export declare function keyedAuthorityChanges(before: Array<{
29
+ key: string;
30
+ }>, after: Array<{
31
+ key: string;
32
+ }>): string[];
33
+ export declare function selectedRevisionReasons(entries: Array<[reason: string, changed: boolean | unknown[]]>): string[];