frontend-project-context 1.6.0 → 1.8.0

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 (60) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +101 -48
  3. package/UPGRADING.md +30 -1
  4. package/docs/05-ACCEPTANCE-CONTRACT.md +20 -1
  5. package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +62 -22
  6. package/docs/14-FORMAL-RELEASE-READINESS.md +9 -5
  7. package/docs/19-POST-1.3.1-AI-TAKEOVER-EVIDENCE-AND-UPGRADE-PLAN.md +5 -5
  8. package/docs/20-PHASE-A-AI-TAKEOVER-AND-HEALTH-CLOSURE-DESIGN.md +11 -11
  9. package/docs/22-PHASE-C-TARGET-UPGRADE-PROTOCOL-DESIGN.md +4 -4
  10. package/docs/23-ADAPTIVE-BOUNDED-TASK-CONTEXT-DESIGN.md +432 -0
  11. package/docs/24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md +210 -0
  12. package/docs/25-REAL-PROJECT-SOURCE-OF-TRUTH-MAINTENANCE-DESIGN.md +409 -0
  13. package/docs/26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md +609 -0
  14. package/docs/27-TEAM-SHARED-CONTEXT-DIRECTION-DISCUSSION.md +30 -0
  15. package/docs/28-REAL-PROJECT-ONBOARDING-CLOSURE-DESIGN.md +534 -0
  16. package/docs/AI-PROJECT-INITIALIZATION.md +89 -0
  17. package/docs/README.md +34 -6
  18. package/docs/USER-AND-AI-OPERATION-MANUAL.md +87 -40
  19. package/examples/README.md +6 -6
  20. package/examples/package.json +1 -1
  21. package/migration-manifest.json +42 -8
  22. package/package.json +2 -2
  23. package/schemas/adaptive-context-bundle.schema.json +70 -0
  24. package/schemas/capabilities.schema.json +37 -8
  25. package/schemas/context-query.schema.json +69 -0
  26. package/schemas/coverage-audit.schema.json +32 -0
  27. package/schemas/evidence-bundle.schema.json +2 -2
  28. package/schemas/host-promotion-evidence.schema.json +33 -0
  29. package/schemas/initialization-instruction.schema.json +60 -0
  30. package/schemas/migration-manifest.schema.json +3 -3
  31. package/schemas/migration-plan.schema.json +2 -2
  32. package/schemas/project-status.schema.json +5 -4
  33. package/schemas/projection-lock.schema.json +1 -1
  34. package/schemas/routing-index.schema.json +58 -0
  35. package/schemas/truth-reconciliation-input.schema.json +60 -0
  36. package/schemas/truth-reconciliation-review-bundle.schema.json +155 -0
  37. package/schemas/upgrade-assessment.schema.json +2 -2
  38. package/schemas/upgrade-result-bundle.schema.json +1 -1
  39. package/src/project-context/a130-evaluation.mjs +91 -0
  40. package/src/project-context/adaptive-context-schema.mjs +392 -0
  41. package/src/project-context/adaptive-context.mjs +547 -0
  42. package/src/project-context/ai-entry.mjs +11 -9
  43. package/src/project-context/assist.mjs +4 -2
  44. package/src/project-context/capabilities.mjs +32 -0
  45. package/src/project-context/checker.mjs +4 -3
  46. package/src/project-context/cli.mjs +55 -5
  47. package/src/project-context/contract-schema.mjs +1 -1
  48. package/src/project-context/discovery.mjs +7 -7
  49. package/src/project-context/exchange-schema.mjs +6 -5
  50. package/src/project-context/initialization-instruction.mjs +42 -0
  51. package/src/project-context/maintenance.mjs +2 -2
  52. package/src/project-context/migration-manifest.mjs +7 -5
  53. package/src/project-context/project-status.mjs +14 -3
  54. package/src/project-context/project-store.mjs +27 -2
  55. package/src/project-context/renderer.mjs +75 -1
  56. package/src/project-context/source-reader.mjs +63 -30
  57. package/src/project-context/task-context.mjs +14 -2
  58. package/src/project-context/truth-reconciliation-schema.mjs +488 -0
  59. package/src/project-context/truth-reconciliation.mjs +543 -0
  60. package/src/project-context/upgrade-schema.mjs +5 -1
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:adaptive-context-bundle:2",
4
+ "title": "Frontend Project Context Adaptive Context Bundle",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "project", "task", "queryDigest", "taskDigest", "level", "expansionDepth", "snapshots", "routing", "guarantees", "globalHealth", "taskHealth", "targetStates", "hydratedItems", "retainedItemIds", "deferredItems", "sources", "evidenceEdges", "readTargets", "findings", "excluded", "metrics", "budget", "delivery", "bundleDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "kind": { "const": "adaptive-context-bundle" },
11
+ "project": { "type": "object", "additionalProperties": false, "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } },
12
+ "task": { "$ref": "context-query.schema.json#/properties/task" },
13
+ "queryDigest": { "$ref": "#/$defs/digest" },
14
+ "taskDigest": { "$ref": "#/$defs/digest" },
15
+ "previousBundleDigest": { "$ref": "#/$defs/digest" },
16
+ "level": { "enum": ["initial", "expanded", "complete"] },
17
+ "expansionDepth": { "type": "integer", "minimum": 0, "maximum": 1 },
18
+ "snapshots": { "$ref": "context-query.schema.json#/$defs/snapshots" },
19
+ "routing": { "type": "object", "additionalProperties": false, "required": ["indexDigest", "indexState"], "properties": { "indexDigest": { "$ref": "#/$defs/digest" }, "indexState": { "enum": ["current", "invalid-rebuilt-in-memory", "stale-rebuilt-in-memory", "missing-rebuilt-in-memory"] }, "rejectedDigest": { "$ref": "#/$defs/digest" } } },
20
+ "guarantees": { "type": "object", "additionalProperties": false, "required": ["registrationCoverage", "mandatoryCoverage", "declaredDependencyCoverage", "retrievalStatus", "semanticCompleteness", "freshness"], "properties": { "registrationCoverage": { "type": "string" }, "mandatoryCoverage": { "enum": ["complete", "blocked"] }, "declaredDependencyCoverage": { "enum": ["complete", "missing", "not-declared"] }, "retrievalStatus": { "enum": ["matched", "no-candidate", "ambiguous", "complete"] }, "semanticCompleteness": { "const": "not-claimed" }, "freshness": { "enum": ["strict-current", "snapshot-and-signal-bound"] } } },
21
+ "globalHealth": { "enum": ["clean", "attention", "conflict", "not-checked", "snapshot-stale"] },
22
+ "taskHealth": { "enum": ["ready", "needs-expansion", "blocked"] },
23
+ "targetStates": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["path", "state"], "properties": { "path": { "type": "string" }, "state": { "enum": ["existing", "prospective-or-deleted"] } } } },
24
+ "hydratedItems": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "kind", "subject", "value", "statement", "scope", "sourceIds", "overrides", "selectionReasons", "itemDigest"], "properties": { "id": { "$ref": "#/$defs/id" }, "kind": { "enum": ["fact", "policy", "reference", "validation-description"] }, "subject": { "$ref": "#/$defs/id" }, "value": {}, "statement": { "type": "string", "minLength": 1 }, "scope": { "$ref": "#/$defs/scope" }, "sourceIds": { "$ref": "#/$defs/ids" }, "overrides": { "$ref": "#/$defs/ids" }, "verification": {}, "selectionReasons": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }, "itemDigest": { "$ref": "#/$defs/digest" } } } },
25
+ "retainedItemIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
26
+ "deferredItems": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "kind", "subject", "scope", "sourceIds", "itemDigest", "reason"], "properties": { "id": { "$ref": "#/$defs/id" }, "kind": { "enum": ["fact", "policy", "reference", "validation-description"] }, "subject": { "$ref": "#/$defs/id" }, "scope": { "$ref": "#/$defs/scope" }, "sourceIds": { "$ref": "#/$defs/ids" }, "itemDigest": { "$ref": "#/$defs/digest" }, "reason": { "const": "applicable-not-selected" } } } },
27
+ "sources": { "type": "array", "items": { "$ref": "#/$defs/sourceEvidence" } },
28
+ "evidenceEdges": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["itemId", "sourceId"], "properties": { "itemId": { "type": "string" }, "sourceId": { "type": "string" } } } },
29
+ "readTargets": { "type": "array", "items": { "$ref": "#/$defs/readTarget" } },
30
+ "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } },
31
+ "excluded": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
32
+ "metrics": { "type": "object", "additionalProperties": false, "required": ["sourceDigestReads", "sourceBodyReads", "sourceIdentityReads", "hydratedItemCount", "retainedItemCount", "deferredItemCount", "hostToolCalls"], "properties": { "sourceDigestReads": { "type": "integer" }, "sourceBodyReads": { "type": "integer" }, "sourceIdentityReads": { "type": "integer" }, "hydratedItemCount": { "type": "integer" }, "retainedItemCount": { "type": "integer" }, "deferredItemCount": { "type": "integer" }, "hostToolCalls": { "const": 1 } } },
33
+ "budget": { "type": "object", "additionalProperties": false, "required": ["unit", "audit", "delivery", "readTargets"], "properties": { "unit": { "const": "canonical-utf8-bytes" }, "audit": { "$ref": "#/$defs/auditBudget" }, "delivery": { "$ref": "#/$defs/deliveryBudget" }, "readTargets": { "$ref": "#/$defs/readBudget" } } },
34
+ "delivery": {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["status", "format", "mode", "itemIds", "contentDigest", "utf8Bytes"],
38
+ "properties": {
39
+ "status": { "enum": ["ready", "withheld"] },
40
+ "format": { "const": "project-context-markdown" },
41
+ "mode": { "type": ["string", "null"], "enum": ["adaptive", "complete", null] },
42
+ "itemIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
43
+ "contentDigest": { "oneOf": [{ "$ref": "#/$defs/digest" }, { "type": "null" }] },
44
+ "utf8Bytes": { "type": "integer", "minimum": 0 }
45
+ }
46
+ },
47
+ "bundleDigest": { "$ref": "#/$defs/digest" }
48
+ },
49
+ "$defs": {
50
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$" },
51
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
52
+ "nullableDigest": { "oneOf": [{ "$ref": "#/$defs/digest" }, { "type": "null" }] },
53
+ "ids": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
54
+ "paths": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
55
+ "scope": { "oneOf": [
56
+ { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "const": "project" } } },
57
+ { "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "enum": ["path-prefix", "file"] }, "path": { "type": "string", "minLength": 1 } } }
58
+ ] },
59
+ "locator": { "oneOf": [
60
+ { "type": "object", "additionalProperties": false, "required": ["path"], "properties": { "path": { "type": "string", "minLength": 1 }, "pointer": { "type": "string" } } },
61
+ { "type": "object", "additionalProperties": false, "required": ["reference"], "properties": { "reference": { "type": "string", "minLength": 1 } } }
62
+ ] },
63
+ "sourceEvidence": { "type": "object", "additionalProperties": false, "required": ["id", "kind", "locator", "sourceDigest", "freshness"], "properties": { "id": { "$ref": "#/$defs/id" }, "kind": { "type": "string", "minLength": 1 }, "locator": { "$ref": "#/$defs/locator" }, "sourceDigest": { "$ref": "#/$defs/digest" }, "freshness": { "enum": ["current", "drifted", "unreadable", "unverifiable-non-local"] }, "expectedDigest": { "$ref": "#/$defs/nullableDigest" }, "actualDigest": { "$ref": "#/$defs/nullableDigest" } } },
64
+ "readTarget": { "type": "object", "additionalProperties": false, "required": ["path", "reason"], "properties": { "path": { "type": "string", "minLength": 1 }, "reason": { "enum": ["task-target", "host-changed-path-signal", "contract-source"] }, "sourceId": { "$ref": "#/$defs/id" } } },
65
+ "finding": { "type": "object", "additionalProperties": false, "required": ["code", "severity"], "properties": { "code": { "type": "string", "minLength": 1 }, "severity": { "enum": ["attention", "needs-expansion", "blocked"] }, "itemId": { "$ref": "#/$defs/id" }, "requiredItemId": { "$ref": "#/$defs/id" }, "sourceId": { "$ref": "#/$defs/id" }, "subject": { "$ref": "#/$defs/id" }, "itemIds": { "$ref": "#/$defs/ids" }, "path": { "type": "string", "minLength": 1 }, "paths": { "$ref": "#/$defs/paths" }, "expected": {}, "actual": {}, "expectedDigest": { "$ref": "#/$defs/nullableDigest" }, "actualDigest": { "$ref": "#/$defs/nullableDigest" }, "reason": { "type": "string", "minLength": 1 }, "state": { "type": "string", "minLength": 1 }, "target": { "type": "integer", "minimum": 0 }, "limit": { "type": "integer", "minimum": 0 }, "required": { "type": "integer", "minimum": 0 }, "conflicts": { "type": "array" }, "projectFinding": {} } },
66
+ "auditBudget": { "type": "object", "additionalProperties": false, "required": ["targetUtf8Bytes", "maxUtf8Bytes", "usedUtf8Bytes"], "properties": { "targetUtf8Bytes": { "type": "integer", "minimum": 1 }, "maxUtf8Bytes": { "type": "integer", "minimum": 1 }, "usedUtf8Bytes": { "type": "integer", "minimum": 1 } } },
67
+ "deliveryBudget": { "type": "object", "additionalProperties": false, "required": ["completeBelowUtf8Bytes", "maxUtf8Bytes", "usedUtf8Bytes"], "properties": { "completeBelowUtf8Bytes": { "type": "integer", "minimum": 1 }, "maxUtf8Bytes": { "type": "integer", "minimum": 1 }, "usedUtf8Bytes": { "type": "integer", "minimum": 0 } } },
68
+ "readBudget": { "type": "object", "additionalProperties": false, "required": ["target", "max", "count"], "properties": { "target": { "type": "integer", "minimum": 1 }, "max": { "type": "integer", "minimum": 1 }, "count": { "type": "integer", "minimum": 0 } } }
69
+ }
70
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:frontend-project-context:schema:capabilities:4",
3
+ "$id": "urn:frontend-project-context:schema:capabilities:8",
4
4
  "title": "Frontend Project Context Capabilities",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
@@ -12,35 +12,41 @@
12
12
  "commands",
13
13
  "actionKinds",
14
14
  "contextBudget",
15
+ "initializationInstruction",
15
16
  "initialization",
16
17
  "initialized",
17
18
  "project",
18
19
  "boundaries"
19
20
  ],
20
21
  "properties": {
21
- "schemaVersion": { "const": 4 },
22
+ "schemaVersion": { "const": 8 },
22
23
  "package": {
23
24
  "type": "object",
24
25
  "additionalProperties": false,
25
26
  "required": ["name", "version"],
26
27
  "properties": {
27
28
  "name": { "const": "frontend-project-context" },
28
- "version": { "const": "1.6.0" }
29
+ "version": { "const": "1.8.0" }
29
30
  }
30
31
  },
31
- "exchangeProtocolVersion": { "const": 4 },
32
+ "exchangeProtocolVersion": { "const": 8 },
32
33
  "schemas": {
33
34
  "type": "object",
34
35
  "additionalProperties": false,
35
36
  "required": [
36
37
  "actionPlan",
38
+ "adaptiveContextBundle",
37
39
  "assistBundle",
38
40
  "capabilities",
39
41
  "contract",
42
+ "contextQuery",
43
+ "coverageAudit",
40
44
  "dashboardViewModel",
41
45
  "evidenceBundle",
42
46
  "evidenceInput",
47
+ "hostPromotionEvidence",
43
48
  "integrationReviewBundle",
49
+ "initializationInstruction",
44
50
  "projectionLock",
45
51
  "projectionLockReadable",
46
52
  "projectionLockWritten",
@@ -51,41 +57,52 @@
51
57
  "migrationManifest",
52
58
  "migrationPlan",
53
59
  "reviewBundle",
60
+ "routingIndex",
54
61
  "sourceLock",
55
62
  "stageContextBundle",
56
63
  "stageReceipt",
57
64
  "taskContextPlan",
65
+ "truthReconciliationInput",
66
+ "truthReconciliationReviewBundle",
58
67
  "upgradeAssessment",
59
68
  "upgradeResultBundle"
60
69
  ],
61
70
  "properties": {
62
71
  "actionPlan": { "const": 2 },
72
+ "adaptiveContextBundle": { "const": 2 },
63
73
  "assistBundle": { "const": 1 },
64
- "capabilities": { "const": 4 },
74
+ "capabilities": { "const": 8 },
65
75
  "contract": { "const": 2 },
76
+ "contextQuery": { "const": 2 },
77
+ "coverageAudit": { "const": 1 },
66
78
  "dashboardViewModel": { "type": "integer" },
67
79
  "evidenceBundle": { "const": 1 },
68
80
  "evidenceInput": { "const": 1 },
81
+ "hostPromotionEvidence": { "const": 1 },
69
82
  "integrationReviewBundle": { "const": 1 },
83
+ "initializationInstruction": { "const": 1 },
70
84
  "projectionLock": { "const": 2 },
71
85
  "projectionLockReadable": { "const": [1, 2] },
72
86
  "projectionLockWritten": { "enum": [1, 2] },
73
87
  "projectionRenderer": { "type": "integer" },
74
88
  "proposal": { "const": 1 },
75
- "projectStatus": { "const": 1 },
76
- "aiEntryRenderer": { "const": 1 },
89
+ "projectStatus": { "const": 2 },
90
+ "aiEntryRenderer": { "const": 4 },
77
91
  "migrationManifest": { "const": 2 },
78
92
  "migrationPlan": { "const": 1 },
79
93
  "reviewBundle": { "const": 2 },
94
+ "routingIndex": { "const": 2 },
80
95
  "sourceLock": { "const": 1 },
81
96
  "stageContextBundle": { "const": 1 },
82
97
  "stageReceipt": { "const": 1 },
83
98
  "taskContextPlan": { "const": 1 },
99
+ "truthReconciliationInput": { "const": 2 },
100
+ "truthReconciliationReviewBundle": { "const": 2 },
84
101
  "upgradeAssessment": { "const": 1 },
85
102
  "upgradeResultBundle": { "const": 1 }
86
103
  }
87
104
  },
88
- "commands": { "type": "array", "minItems": 1, "uniqueItems": true, "allOf": [{"contains": {"const": "upgrade-check"}}, {"contains": {"const": "upgrade-plan"}}, {"contains": {"const": "upgrade-apply"}}], "items": { "type": "string" } },
105
+ "commands": { "type": "array", "minItems": 1, "uniqueItems": true, "allOf": [{"contains": {"const": "instructions"}}, {"contains": {"const": "upgrade-check"}}, {"contains": {"const": "upgrade-plan"}}, {"contains": {"const": "upgrade-apply"}}], "items": { "type": "string" } },
89
106
  "actionKinds": {
90
107
  "type": "array",
91
108
  "minItems": 10,
@@ -116,6 +133,18 @@
116
133
  "callerMustProvideLimit": { "const": true }
117
134
  }
118
135
  },
136
+ "initializationInstruction": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": ["id", "version", "packagePath", "digest", "command"],
140
+ "properties": {
141
+ "id": {"const": "ai-project-initialization"},
142
+ "version": {"const": 1},
143
+ "packagePath": {"const": "docs/AI-PROJECT-INITIALIZATION.md"},
144
+ "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
145
+ "command": {"const": "project-context instructions --project PATH [--json | --prompt]"}
146
+ }
147
+ },
119
148
  "initialization": { "enum": ["uninitialized", "partial", "initialized"] },
120
149
  "initialized": { "type": "boolean" },
121
150
  "project": {
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:context-query:2",
4
+ "title": "Frontend Project Context Query",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "projectId", "snapshots", "task", "level", "freshness", "budget", "expansion"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "kind": { "const": "context-query" },
11
+ "projectId": { "$ref": "#/$defs/id" },
12
+ "snapshots": { "$ref": "#/$defs/snapshots" },
13
+ "task": {
14
+ "type": "object", "additionalProperties": false,
15
+ "required": ["text", "paths", "topics", "itemIds", "changedPaths"],
16
+ "properties": {
17
+ "text": { "type": "string", "minLength": 1 },
18
+ "paths": { "$ref": "#/$defs/nonEmptyPaths" },
19
+ "topics": { "$ref": "#/$defs/texts" },
20
+ "itemIds": { "$ref": "#/$defs/ids" },
21
+ "changedPaths": { "$ref": "#/$defs/paths" }
22
+ }
23
+ },
24
+ "level": { "enum": ["initial", "expanded", "complete"] },
25
+ "freshness": { "enum": ["snapshot-and-signal-bound", "strict-current"] },
26
+ "budget": {
27
+ "type": "object", "additionalProperties": false, "required": ["audit", "delivery", "readTargets"],
28
+ "properties": {
29
+ "audit": { "$ref": "#/$defs/auditBudget" },
30
+ "delivery": { "$ref": "#/$defs/deliveryBudget" },
31
+ "readTargets": { "$ref": "#/$defs/readBudget" }
32
+ }
33
+ },
34
+ "expansion": {
35
+ "oneOf": [
36
+ { "type": "null" },
37
+ {
38
+ "type": "object", "additionalProperties": false,
39
+ "required": ["previousBundleDigest", "requestedItemIds", "requestedSubjects", "requestedSourceIds"],
40
+ "properties": {
41
+ "previousBundleDigest": { "$ref": "#/$defs/digest" },
42
+ "requestedItemIds": { "$ref": "#/$defs/ids" },
43
+ "requestedSubjects": { "$ref": "#/$defs/ids" },
44
+ "requestedSourceIds": { "$ref": "#/$defs/ids" }
45
+ }
46
+ }
47
+ ]
48
+ }
49
+ },
50
+ "allOf": [
51
+ { "if": { "properties": { "level": { "const": "expanded" } } }, "then": { "properties": { "expansion": { "type": "object" } } } },
52
+ { "if": { "properties": { "level": { "enum": ["initial", "complete"] } } }, "then": { "properties": { "expansion": { "type": "null" } } } }
53
+ ],
54
+ "$defs": {
55
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$" },
56
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
57
+ "ids": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
58
+ "paths": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
59
+ "nonEmptyPaths": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
60
+ "texts": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
61
+ "snapshots": {
62
+ "type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"],
63
+ "properties": { "contract": { "$ref": "#/$defs/digest" }, "sourcesLock": { "$ref": "#/$defs/digest" }, "projectionsLock": { "$ref": "#/$defs/digest" } }
64
+ },
65
+ "auditBudget": { "type": "object", "additionalProperties": false, "required": ["targetUtf8Bytes", "maxUtf8Bytes"], "properties": { "targetUtf8Bytes": { "type": "integer", "minimum": 1 }, "maxUtf8Bytes": { "type": "integer", "minimum": 1 } } },
66
+ "deliveryBudget": { "type": "object", "additionalProperties": false, "required": ["completeBelowUtf8Bytes", "maxUtf8Bytes"], "properties": { "completeBelowUtf8Bytes": { "type": "integer", "minimum": 1 }, "maxUtf8Bytes": { "type": "integer", "minimum": 1 } } },
67
+ "readBudget": { "type": "object", "additionalProperties": false, "required": ["target", "max"], "properties": { "target": { "type": "integer", "minimum": 1 }, "max": { "type": "integer", "minimum": 1 } } }
68
+ }
69
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:coverage-audit:1",
4
+ "title": "Frontend Project Context Coverage Audit",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "project", "snapshots", "profile", "registrationCoverage", "categories", "guarantee", "auditDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "kind": { "const": "coverage-audit" },
11
+ "project": { "type": "object", "additionalProperties": false, "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } },
12
+ "snapshots": { "$ref": "context-query.schema.json#/$defs/snapshots" },
13
+ "profile": { "type": ["object", "null"] },
14
+ "registrationCoverage": { "enum": ["not-declared", "review-required", "closed-for-declared-scope"] },
15
+ "categories": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["registered", "excluded-approved", "review-required", "outside-declared-coverage"],
19
+ "properties": {
20
+ "registered": { "$ref": "#/$defs/candidates" },
21
+ "excluded-approved": { "$ref": "#/$defs/candidates" },
22
+ "review-required": { "$ref": "#/$defs/candidates" },
23
+ "outside-declared-coverage": { "$ref": "#/$defs/candidates" }
24
+ }
25
+ },
26
+ "guarantee": { "const": "declared-scope-only-never-all-project-truth" },
27
+ "auditDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
28
+ },
29
+ "$defs": {
30
+ "candidates": { "type": "array", "items": { "type": "object", "required": ["path", "origin"], "properties": { "path": { "type": "string" }, "origin": { "type": "string" }, "proposedSourceId": { "type": "string" } } } }
31
+ }
32
+ }
@@ -14,8 +14,8 @@
14
14
  "required": ["name", "version", "exchangeProtocolVersion"],
15
15
  "properties": {
16
16
  "name": { "const": "frontend-project-context" },
17
- "version": { "const": "1.6.0" },
18
- "exchangeProtocolVersion": { "const": 3 }
17
+ "version": { "const": "1.8.0" },
18
+ "exchangeProtocolVersion": { "const": 6 }
19
19
  }
20
20
  },
21
21
  "capability": { "enum": ["setup", "takeover", "maintenance", "staged-context", "upgrade", "other-protocol"] },
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:host-promotion-evidence:1",
4
+ "title": "Frontend Project Context Host Promotion Evidence",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "taskId", "stage", "baseRevision", "candidateRevision", "codeSnapshotDigest", "sourceSnapshotDigest", "artifactDigest", "changedPaths", "projectSnapshots", "acceptanceSuiteDigest", "verificationResults"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "kind": { "const": "host-promotion-evidence" },
11
+ "taskId": { "$ref": "#/$defs/id" },
12
+ "stage": { "enum": ["qa", "preproduction", "production", "withdrawn", "rollback"] },
13
+ "baseRevision": { "$ref": "#/$defs/text" },
14
+ "candidateRevision": { "$ref": "#/$defs/text" },
15
+ "codeSnapshotDigest": { "$ref": "#/$defs/digest" },
16
+ "sourceSnapshotDigest": { "$ref": "#/$defs/digest" },
17
+ "artifactDigest": { "$ref": "#/$defs/digest" },
18
+ "changedPaths": { "$ref": "#/$defs/paths" },
19
+ "projectSnapshots": { "$ref": "#/$defs/snapshots" },
20
+ "acceptanceSuiteDigest": { "$ref": "#/$defs/digest" },
21
+ "verificationResults": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/verification" } },
22
+ "integration": { "type": "boolean", "default": false },
23
+ "equivalentToCodeSnapshotDigest": { "$ref": "#/$defs/digest" }
24
+ },
25
+ "$defs": {
26
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$" },
27
+ "text": { "type": "string", "minLength": 1 },
28
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
29
+ "paths": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
30
+ "snapshots": { "type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"], "properties": { "contract": { "$ref": "#/$defs/digest" }, "sourcesLock": { "$ref": "#/$defs/digest" }, "projectionsLock": { "$ref": "#/$defs/digest" } } },
31
+ "verification": { "type": "object", "additionalProperties": false, "required": ["id", "status"], "properties": { "id": { "$ref": "#/$defs/id" }, "status": { "enum": ["passed", "failed", "skipped", "observed"] } } }
32
+ }
33
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:initialization-instruction:1",
4
+ "title": "Frontend Project Context Initialization Instruction",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "package", "instruction", "targetRoot", "boundaries"],
8
+ "properties": {
9
+ "schemaVersion": {"const": 1},
10
+ "package": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["name", "version"],
14
+ "properties": {
15
+ "name": {"const": "frontend-project-context"},
16
+ "version": {"const": "1.8.0"}
17
+ }
18
+ },
19
+ "instruction": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["id", "version", "packagePath", "digest", "content"],
23
+ "properties": {
24
+ "id": {"const": "ai-project-initialization"},
25
+ "version": {"const": 1},
26
+ "packagePath": {"const": "docs/AI-PROJECT-INITIALIZATION.md"},
27
+ "digest": {"$ref": "#/$defs/digest"},
28
+ "content": {"type": "string", "minLength": 1}
29
+ }
30
+ },
31
+ "targetRoot": {"type": "string", "minLength": 1},
32
+ "boundaries": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["provider", "agentRuntime", "git", "network", "dependencyInstallation", "automaticApproval", "businessCodeWrites", "taskExecution", "stagePathBodyReads", "applyPlan", "scheduler", "daemon", "telemetry", "selfUpdate", "automaticEvidenceUpload", "packageManager", "automaticUpgrade"],
36
+ "properties": {
37
+ "provider": {"const": false},
38
+ "agentRuntime": {"const": false},
39
+ "git": {"const": false},
40
+ "network": {"const": false},
41
+ "dependencyInstallation": {"const": false},
42
+ "automaticApproval": {"const": false},
43
+ "businessCodeWrites": {"const": false},
44
+ "taskExecution": {"const": false},
45
+ "stagePathBodyReads": {"const": false},
46
+ "applyPlan": {"const": false},
47
+ "scheduler": {"const": false},
48
+ "daemon": {"const": false},
49
+ "telemetry": {"const": false},
50
+ "selfUpdate": {"const": false},
51
+ "automaticEvidenceUpload": {"const": false},
52
+ "packageManager": {"const": false},
53
+ "automaticUpgrade": {"const": false}
54
+ }
55
+ }
56
+ },
57
+ "$defs": {
58
+ "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"}
59
+ }
60
+ }
@@ -7,12 +7,12 @@
7
7
  "required": ["schemaVersion", "package", "upgradeFrom", "stores", "renderers", "protocols", "paths", "builtInMigrations", "consumerChanges", "acceptanceCommands", "rollback", "externalEffects", "manifestDigest"],
8
8
  "properties": {
9
9
  "schemaVersion": {"const": 2},
10
- "package": {"type": "object", "additionalProperties": false, "required": ["name", "version"], "properties": {"name": {"const": "frontend-project-context"}, "version": {"const": "1.6.0"}}},
11
- "upgradeFrom": {"const": ["1.3.1", "1.4.0", "1.5.0"]},
10
+ "package": {"type": "object", "additionalProperties": false, "required": ["name", "version"], "properties": {"name": {"const": "frontend-project-context"}, "version": {"const": "1.8.0"}}},
11
+ "upgradeFrom": {"const": ["1.3.1", "1.4.0", "1.5.0", "1.6.0", "1.7.0"]},
12
12
  "stores": {"type": "object", "additionalProperties": false, "required": ["contract", "projectionLock", "proposal", "sourceLock"], "properties": {"contract": {"$ref": "#/$defs/versionMatrix"}, "projectionLock": {"$ref": "#/$defs/versionMatrix"}, "proposal": {"$ref": "#/$defs/versionMatrix"}, "sourceLock": {"$ref": "#/$defs/versionMatrix"}}},
13
13
  "renderers": {"type": "object", "additionalProperties": false, "required": ["aiEntry", "projection"], "properties": {"aiEntry": {"$ref": "#/$defs/versionTarget"}, "projection": {"$ref": "#/$defs/versionTarget"}}},
14
14
  "protocols": {"type": "object", "additionalProperties": {"$ref": "#/$defs/versionTarget"}},
15
- "paths": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "object", "additionalProperties": false, "required": ["fromVersion", "classification", "migrationIds", "requiresHumanReview", "rollbackClass", "acceptance"], "properties": {"fromVersion": {"enum": ["1.3.1", "1.4.0", "1.5.0"]}, "classification": {"enum": ["package-only", "republish-ai-entry", "republish-projection", "built-in-store-migration", "invalidate-ephemeral-protocol"]}, "migrationIds": {"$ref": "#/$defs/strings"}, "requiresHumanReview": {"type": "boolean"}, "rollbackClass": {"$ref": "#/$defs/rollbackClass"}, "acceptance": {"$ref": "#/$defs/strings"}}}},
15
+ "paths": {"type": "array", "minItems": 5, "maxItems": 5, "items": {"type": "object", "additionalProperties": false, "required": ["fromVersion", "classification", "migrationIds", "requiresHumanReview", "rollbackClass", "acceptance"], "properties": {"fromVersion": {"enum": ["1.3.1", "1.4.0", "1.5.0", "1.6.0", "1.7.0"]}, "classification": {"enum": ["package-only", "republish-ai-entry", "republish-projection", "built-in-store-migration", "invalidate-ephemeral-protocol"]}, "migrationIds": {"$ref": "#/$defs/strings"}, "requiresHumanReview": {"type": "boolean"}, "rollbackClass": {"$ref": "#/$defs/rollbackClass"}, "acceptance": {"$ref": "#/$defs/strings"}}}},
16
16
  "builtInMigrations": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["id", "kind", "input", "targetType", "writes", "rollbackClass", "reverseMigrationId"], "properties": {"id": {"type": "string"}, "kind": {"enum": ["package-only", "republish-ai-entry", "republish-projection", "built-in-store-migration", "invalidate-ephemeral-protocol"]}, "input": {"type": "object", "additionalProperties": false, "required": ["schemaVersions", "beforeDigestRequired"], "properties": {"schemaVersions": {"type": "array", "items": {"type": "integer", "minimum": 1}}, "beforeDigestRequired": {"type": "boolean"}}}, "targetType": {"enum": ["none", "ai-entry", "projection", "store", "ephemeral-protocol"]}, "writes": {"type": "boolean"}, "rollbackClass": {"$ref": "#/$defs/rollbackClass"}, "reverseMigrationId": {"type": ["string", "null"]}}}},
17
17
  "consumerChanges": {"type": "object", "additionalProperties": {"type": "object", "additionalProperties": false, "required": ["state", "reason"], "properties": {"state": {"enum": ["preserve", "regenerate", "invalidate"]}, "reason": {"type": "string"}}}},
18
18
  "acceptanceCommands": {"$ref": "#/$defs/strings"},
@@ -8,8 +8,8 @@
8
8
  "properties": {
9
9
  "schemaVersion": {"const": 1},
10
10
  "kind": {"const": "target-upgrade-plan"},
11
- "fromVersion": {"enum": ["1.3.1", "1.4.0", "1.5.0"]},
12
- "targetVersion": {"const": "1.6.0"},
11
+ "fromVersion": {"enum": ["1.3.1", "1.4.0", "1.5.0", "1.6.0", "1.7.0"]},
12
+ "targetVersion": {"const": "1.8.0"},
13
13
  "manifestDigest": {"$ref": "#/$defs/digest"},
14
14
  "assessmentDigest": {"$ref": "#/$defs/digest"},
15
15
  "snapshots": {"anyOf": [{"type": "null"}, {"$ref": "#/$defs/snapshots"}]},
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:frontend-project-context:schema:project-status:1",
3
+ "$id": "urn:frontend-project-context:schema:project-status:2",
4
4
  "title": "Frontend Project Context Project Status",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["schemaVersion", "package", "initialization", "project", "snapshots", "health", "entry", "summary", "findingCodes", "sourceIds", "itemIds", "projectionPaths", "readTargets", "workUnits", "nextActions", "boundaries"],
7
+ "required": ["schemaVersion", "package", "initialization", "project", "snapshots", "health", "entry", "contractReadiness", "summary", "findingCodes", "sourceIds", "itemIds", "projectionPaths", "readTargets", "workUnits", "nextActions", "boundaries"],
8
8
  "properties": {
9
- "schemaVersion": { "const": 1 },
9
+ "schemaVersion": { "const": 2 },
10
10
  "package": {
11
11
  "type": "object",
12
12
  "additionalProperties": false,
@@ -36,6 +36,7 @@
36
36
  "rendererVersion": { "type": ["integer", "null"] }
37
37
  }
38
38
  },
39
+ "contractReadiness": {"enum": ["not-initialized", "contract-incomplete", "contract-ready"]},
39
40
  "summary": {
40
41
  "type": "object",
41
42
  "additionalProperties": false,
@@ -56,7 +57,7 @@
56
57
  "nextActions": {
57
58
  "type": "array",
58
59
  "uniqueItems": true,
59
- "items": { "enum": ["run-setup-preview", "run-sync", "review-pending", "review-source-change", "review-projection", "publish-ai-entry", "resolve-conflict", "ready-for-task"] }
60
+ "items": { "enum": ["read-initialization-instructions", "complete-onboarding", "compile-task-context", "run-sync", "review-pending", "review-source-change", "review-projection", "publish-ai-entry", "resolve-conflict"] }
60
61
  },
61
62
  "boundaries": { "type": "object", "additionalProperties": { "const": false } }
62
63
  },
@@ -33,7 +33,7 @@
33
33
  "properties": {
34
34
  "path": { "type": "string" }, "target": { "const": "ai-entry" }, "ownership": { "const": "region" },
35
35
  "regionId": { "const": "project-context-ai-entry" }, "regionDigest": { "$ref": "#/$defs/digest" },
36
- "rendererVersion": { "const": 1 }, "createdFile": { "type": "boolean" }
36
+ "rendererVersion": { "enum": [1, 2, 3] }, "createdFile": { "type": "boolean" }
37
37
  }
38
38
  },
39
39
  "schema1": {
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:routing-index:2",
4
+ "title": "Frontend Project Context Routing Index",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "projectId", "selectorVersion", "snapshots", "items", "sources", "indexDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "kind": { "const": "routing-index" },
11
+ "projectId": { "type": "string" },
12
+ "selectorVersion": { "const": 2 },
13
+ "snapshots": { "$ref": "context-query.schema.json#/$defs/snapshots" },
14
+ "items": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["id", "kind", "subject", "scope", "sourceIds", "terms", "itemDigest"],
20
+ "properties": {
21
+ "id": { "type": "string" },
22
+ "kind": { "enum": ["fact", "policy", "reference", "validation-description"] },
23
+ "subject": { "type": "string" },
24
+ "scope": { "$ref": "#/$defs/scope" },
25
+ "sourceIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
26
+ "terms": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
27
+ "itemDigest": { "type": "string" }
28
+ }
29
+ }
30
+ },
31
+ "sources": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["id", "kind", "locator", "itemIds", "sourceDigest"],
37
+ "properties": {
38
+ "id": { "type": "string" },
39
+ "kind": { "type": "string" },
40
+ "locator": { "$ref": "#/$defs/locator" },
41
+ "itemIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
42
+ "sourceDigest": { "type": "string" }
43
+ }
44
+ }
45
+ },
46
+ "indexDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
47
+ },
48
+ "$defs": {
49
+ "scope": { "oneOf": [
50
+ { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "const": "project" } } },
51
+ { "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "enum": ["path-prefix", "file"] }, "path": { "type": "string", "minLength": 1 } } }
52
+ ] },
53
+ "locator": { "oneOf": [
54
+ { "type": "object", "additionalProperties": false, "required": ["path"], "properties": { "path": { "type": "string", "minLength": 1 }, "pointer": { "type": "string" } } },
55
+ { "type": "object", "additionalProperties": false, "required": ["reference"], "properties": { "reference": { "type": "string", "minLength": 1 } } }
56
+ ] }
57
+ }
58
+ }