frontend-project-context 1.3.1 → 1.7.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 (67) hide show
  1. package/CHANGELOG.md +51 -2
  2. package/README.md +156 -40
  3. package/UPGRADING.md +55 -1
  4. package/docs/04-PROGRAM-DESIGN.md +34 -4
  5. package/docs/05-ACCEPTANCE-CONTRACT.md +40 -3
  6. package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +67 -22
  7. package/docs/14-FORMAL-RELEASE-READINESS.md +30 -1
  8. package/docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md +2 -2
  9. package/docs/19-POST-1.3.1-AI-TAKEOVER-EVIDENCE-AND-UPGRADE-PLAN.md +579 -0
  10. package/docs/20-PHASE-A-AI-TAKEOVER-AND-HEALTH-CLOSURE-DESIGN.md +535 -0
  11. package/docs/21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md +347 -0
  12. package/docs/22-PHASE-C-TARGET-UPGRADE-PROTOCOL-DESIGN.md +398 -0
  13. package/docs/23-ADAPTIVE-BOUNDED-TASK-CONTEXT-DESIGN.md +432 -0
  14. package/docs/24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md +210 -0
  15. package/docs/25-REAL-PROJECT-SOURCE-OF-TRUTH-MAINTENANCE-DESIGN.md +409 -0
  16. package/docs/26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md +609 -0
  17. package/docs/README.md +38 -6
  18. package/docs/USER-AND-AI-OPERATION-MANUAL.md +840 -0
  19. package/examples/README.md +29 -2
  20. package/examples/package.json +6 -2
  21. package/migration-manifest.json +110 -0
  22. package/package.json +3 -2
  23. package/schemas/action-plan.schema.json +31 -3
  24. package/schemas/adaptive-context-bundle.schema.json +70 -0
  25. package/schemas/capabilities.schema.json +64 -18
  26. package/schemas/context-query.schema.json +69 -0
  27. package/schemas/coverage-audit.schema.json +32 -0
  28. package/schemas/evidence-bundle.schema.json +64 -0
  29. package/schemas/evidence-input.schema.json +82 -0
  30. package/schemas/host-promotion-evidence.schema.json +33 -0
  31. package/schemas/migration-manifest.schema.json +29 -0
  32. package/schemas/migration-plan.schema.json +32 -0
  33. package/schemas/project-status.schema.json +75 -0
  34. package/schemas/projection-lock.schema.json +48 -0
  35. package/schemas/review-bundle.schema.json +3 -3
  36. package/schemas/routing-index.schema.json +58 -0
  37. package/schemas/truth-reconciliation-input.schema.json +60 -0
  38. package/schemas/truth-reconciliation-review-bundle.schema.json +155 -0
  39. package/schemas/upgrade-assessment.schema.json +48 -0
  40. package/schemas/upgrade-result-bundle.schema.json +35 -0
  41. package/src/project-context/a130-evaluation.mjs +91 -0
  42. package/src/project-context/adaptive-context-schema.mjs +392 -0
  43. package/src/project-context/adaptive-context.mjs +547 -0
  44. package/src/project-context/ai-entry.mjs +320 -0
  45. package/src/project-context/assist.mjs +4 -2
  46. package/src/project-context/capabilities.mjs +62 -17
  47. package/src/project-context/checker.mjs +24 -6
  48. package/src/project-context/cli.mjs +113 -3
  49. package/src/project-context/contract-schema.mjs +30 -16
  50. package/src/project-context/dashboard-model.mjs +4 -4
  51. package/src/project-context/dashboard-renderer.mjs +3 -3
  52. package/src/project-context/discovery.mjs +13 -8
  53. package/src/project-context/evidence-schema.mjs +209 -0
  54. package/src/project-context/evidence.mjs +99 -0
  55. package/src/project-context/exchange-schema.mjs +23 -12
  56. package/src/project-context/exchange.mjs +26 -4
  57. package/src/project-context/maintenance.mjs +4 -4
  58. package/src/project-context/migration-manifest.mjs +168 -0
  59. package/src/project-context/project-status.mjs +157 -0
  60. package/src/project-context/projection-store.mjs +8 -1
  61. package/src/project-context/renderer.mjs +75 -1
  62. package/src/project-context/source-reader.mjs +63 -30
  63. package/src/project-context/task-context.mjs +14 -2
  64. package/src/project-context/truth-reconciliation-schema.mjs +488 -0
  65. package/src/project-context/truth-reconciliation.mjs +543 -0
  66. package/src/project-context/upgrade-schema.mjs +219 -0
  67. package/src/project-context/upgrade.mjs +494 -0
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:evidence-bundle:1",
4
+ "title": "Frontend Project Context Evidence Bundle",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "product", "capability", "result", "environment", "expected", "observed", "errorCodes", "reproduction", "artifacts", "redactions", "projectContext", "transfer", "boundaries", "bundleDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "kind": { "const": "target-project-evidence" },
11
+ "product": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["name", "version", "exchangeProtocolVersion"],
15
+ "properties": {
16
+ "name": { "const": "frontend-project-context" },
17
+ "version": { "const": "1.7.0" },
18
+ "exchangeProtocolVersion": { "const": 6 }
19
+ }
20
+ },
21
+ "capability": { "enum": ["setup", "takeover", "maintenance", "staged-context", "upgrade", "other-protocol"] },
22
+ "result": { "$ref": "evidence-input.schema.json#/$defs/result" },
23
+ "environment": { "$ref": "evidence-input.schema.json#/properties/environment" },
24
+ "expected": { "$ref": "evidence-input.schema.json#/$defs/observation" },
25
+ "observed": { "$ref": "evidence-input.schema.json#/$defs/observation" },
26
+ "errorCodes": { "$ref": "evidence-input.schema.json#/$defs/codes" },
27
+ "reproduction": { "$ref": "evidence-input.schema.json#/properties/reproduction" },
28
+ "artifacts": { "$ref": "evidence-input.schema.json#/properties/artifacts" },
29
+ "redactions": { "$ref": "evidence-input.schema.json#/properties/redactions" },
30
+ "projectContext": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["initialization", "health", "entryState", "findingCodes", "schemas"],
34
+ "properties": {
35
+ "initialization": { "enum": ["uninitialized", "partial", "invalid", "initialized"] },
36
+ "health": { "enum": ["uninitialized", "partial", "invalid", "attention", "clean", "conflict"] },
37
+ "entryState": { "enum": ["absent", "current", "stale", "conflict"] },
38
+ "findingCodes": { "$ref": "evidence-input.schema.json#/$defs/codes" },
39
+ "schemas": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["contract", "sourcesLock", "projectionsLock"],
43
+ "properties": {
44
+ "contract": { "const": 2 },
45
+ "sourcesLock": { "const": 1 },
46
+ "projectionsLock": { "const": 2 }
47
+ }
48
+ }
49
+ }
50
+ },
51
+ "transfer": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["state", "automaticUpload", "destination"],
55
+ "properties": {
56
+ "state": { "const": "human-review-required" },
57
+ "automaticUpload": { "const": false },
58
+ "destination": { "type": "null" }
59
+ }
60
+ },
61
+ "boundaries": { "$ref": "capabilities.schema.json#/properties/boundaries" },
62
+ "bundleDigest": { "$ref": "evidence-input.schema.json#/$defs/digest" }
63
+ }
64
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:evidence-input:1",
4
+ "title": "Frontend Project Context Evidence Input",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "capability", "result", "environment", "expected", "observed", "errorCodes", "reproduction", "artifacts", "redactions"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "capability": { "enum": ["setup", "takeover", "maintenance", "staged-context", "upgrade", "other-protocol"] },
11
+ "result": { "$ref": "#/$defs/result" },
12
+ "environment": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["runtime", "runtimeMajor", "packageManager", "projectShape"],
16
+ "properties": {
17
+ "runtime": { "enum": ["node", "other", "redacted"] },
18
+ "runtimeMajor": { "type": "integer", "minimum": 0, "maximum": 999 },
19
+ "packageManager": { "enum": ["npm", "pnpm", "yarn", "bun", "other", "redacted"] },
20
+ "projectShape": { "enum": ["single", "monorepo", "multi-context", "redacted"] }
21
+ }
22
+ },
23
+ "expected": { "$ref": "#/$defs/observation" },
24
+ "observed": { "$ref": "#/$defs/observation" },
25
+ "errorCodes": { "$ref": "#/$defs/codes" },
26
+ "reproduction": {
27
+ "type": "array",
28
+ "maxItems": 20,
29
+ "items": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["operation", "outcome", "findingCodes"],
33
+ "properties": {
34
+ "operation": { "enum": ["capabilities", "status", "setup-preview", "sync", "check", "context", "preflight", "stage-context", "integration-review", "publish-entry-preview", "remove-entry-preview", "upgrade-baseline", "other-protocol"] },
35
+ "outcome": { "$ref": "#/$defs/result" },
36
+ "findingCodes": { "$ref": "#/$defs/codes" }
37
+ }
38
+ }
39
+ },
40
+ "artifacts": {
41
+ "type": "array",
42
+ "maxItems": 32,
43
+ "items": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["kind", "digest"],
47
+ "properties": {
48
+ "kind": { "$ref": "#/$defs/id" },
49
+ "digest": { "$ref": "#/$defs/digest" }
50
+ }
51
+ }
52
+ },
53
+ "redactions": {
54
+ "type": "array",
55
+ "maxItems": 32,
56
+ "items": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": ["field", "method"],
60
+ "properties": {
61
+ "field": { "type": "string", "pattern": "^[a-z][A-Za-z0-9]*(\\.[a-z][A-Za-z0-9]*)*$" },
62
+ "method": { "enum": ["removed", "generalized", "hashed", "redacted", "not-collected"] }
63
+ }
64
+ }
65
+ }
66
+ },
67
+ "$defs": {
68
+ "id": { "type": "string", "pattern": "^[a-z0-9]+([.-][a-z0-9]+)*$" },
69
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
70
+ "result": { "enum": ["passed", "degraded", "blocked", "failed"] },
71
+ "codes": { "type": "array", "maxItems": 32, "items": { "$ref": "#/$defs/id" } },
72
+ "observation": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["code", "summary"],
76
+ "properties": {
77
+ "code": { "$ref": "#/$defs/id" },
78
+ "summary": { "type": "string", "minLength": 1, "maxLength": 500, "pattern": "^[^\\r\\n\\u2028\\u2029]+$" }
79
+ }
80
+ }
81
+ }
82
+ }
@@ -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,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:migration-manifest:2",
4
+ "title": "Frontend Project Context Migration Manifest",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "package", "upgradeFrom", "stores", "renderers", "protocols", "paths", "builtInMigrations", "consumerChanges", "acceptanceCommands", "rollback", "externalEffects", "manifestDigest"],
8
+ "properties": {
9
+ "schemaVersion": {"const": 2},
10
+ "package": {"type": "object", "additionalProperties": false, "required": ["name", "version"], "properties": {"name": {"const": "frontend-project-context"}, "version": {"const": "1.7.0"}}},
11
+ "upgradeFrom": {"const": ["1.3.1", "1.4.0", "1.5.0", "1.6.0"]},
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
+ "renderers": {"type": "object", "additionalProperties": false, "required": ["aiEntry", "projection"], "properties": {"aiEntry": {"$ref": "#/$defs/versionTarget"}, "projection": {"$ref": "#/$defs/versionTarget"}}},
14
+ "protocols": {"type": "object", "additionalProperties": {"$ref": "#/$defs/versionTarget"}},
15
+ "paths": {"type": "array", "minItems": 4, "maxItems": 4, "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"]}, "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
+ "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
+ "consumerChanges": {"type": "object", "additionalProperties": {"type": "object", "additionalProperties": false, "required": ["state", "reason"], "properties": {"state": {"enum": ["preserve", "regenerate", "invalidate"]}, "reason": {"type": "string"}}}},
18
+ "acceptanceCommands": {"$ref": "#/$defs/strings"},
19
+ "rollback": {"type": "object", "additionalProperties": false, "required": ["defaultClass", "externalRestoreRequired", "automatic"], "properties": {"defaultClass": {"$ref": "#/$defs/rollbackClass"}, "externalRestoreRequired": {"type": "boolean"}, "automatic": {"const": false}}},
20
+ "externalEffects": {"type": "object", "additionalProperties": false, "required": ["packageManager", "network", "git", "projectTests", "businessCode", "automaticUpgrade"], "properties": {"packageManager": {"const": false}, "network": {"const": false}, "git": {"const": false}, "projectTests": {"const": false}, "businessCode": {"const": false}, "automaticUpgrade": {"const": false}}},
21
+ "manifestDigest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"}
22
+ },
23
+ "$defs": {
24
+ "strings": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
25
+ "rollbackClass": {"enum": ["package-only", "reversible-data", "forward-only"]},
26
+ "versionMatrix": {"type": "object", "additionalProperties": false, "required": ["readable", "written"], "properties": {"readable": {"type": "array", "uniqueItems": true, "items": {"type": "integer", "minimum": 1}}, "written": {"type": "array", "uniqueItems": true, "items": {"type": "integer", "minimum": 1}}}},
27
+ "versionTarget": {"type": "object", "additionalProperties": false, "required": ["readable", "written"], "properties": {"readable": {"type": "array", "uniqueItems": true, "items": {"type": "integer", "minimum": 1}}, "written": {"type": "integer", "minimum": 1}}}
28
+ }
29
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:migration-plan:1",
4
+ "title": "Frontend Project Context Migration Plan",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "fromVersion", "targetVersion", "manifestDigest", "assessmentDigest", "snapshots", "targetDigests", "nextAction", "remainingMigrationIds", "acceptance", "rollback", "requiresHumanReview", "authority", "planDigest"],
8
+ "properties": {
9
+ "schemaVersion": {"const": 1},
10
+ "kind": {"const": "target-upgrade-plan"},
11
+ "fromVersion": {"enum": ["1.3.1", "1.4.0", "1.5.0", "1.6.0"]},
12
+ "targetVersion": {"const": "1.7.0"},
13
+ "manifestDigest": {"$ref": "#/$defs/digest"},
14
+ "assessmentDigest": {"$ref": "#/$defs/digest"},
15
+ "snapshots": {"anyOf": [{"type": "null"}, {"$ref": "#/$defs/snapshots"}]},
16
+ "targetDigests": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "beforeDigest"], "properties": {"path": {"$ref": "#/$defs/path"}, "beforeDigest": {"anyOf": [{"type": "null"}, {"$ref": "#/$defs/digest"}]}}}},
17
+ "nextAction": {"$ref": "#/$defs/action"},
18
+ "remainingMigrationIds": {"$ref": "#/$defs/strings"},
19
+ "acceptance": {"type": "object", "additionalProperties": false, "required": ["core", "hostRequired"], "properties": {"core": {"$ref": "#/$defs/strings"}, "hostRequired": {"$ref": "#/$defs/strings"}}},
20
+ "rollback": {"type": "object", "additionalProperties": false, "required": ["class", "reverseMigrationId", "externalRestoreRequired"], "properties": {"class": {"enum": ["package-only", "reversible-data", "forward-only"]}, "reverseMigrationId": {"type": ["string", "null"]}, "externalRestoreRequired": {"type": "boolean"}}},
21
+ "requiresHumanReview": {"type": "boolean"},
22
+ "authority": {"const": "human-explicit-write-required"},
23
+ "planDigest": {"$ref": "#/$defs/digest"}
24
+ },
25
+ "$defs": {
26
+ "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
27
+ "strings": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
28
+ "snapshots": {"type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"], "properties": {"contract": {"$ref": "#/$defs/digest"}, "sourcesLock": {"$ref": "#/$defs/digest"}, "projectionsLock": {"$ref": "#/$defs/digest"}}},
29
+ "path": {"type": "string", "minLength": 1, "pattern": "^(?!/)(?![A-Za-z]:)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$"},
30
+ "action": {"type": "object", "additionalProperties": false, "required": ["id", "kind", "migrationId", "targets", "writes", "semanticImpact"], "properties": {"id": {"type": "string"}, "kind": {"enum": ["verify-complete", "republish-ai-entry", "republish-projection", "built-in-store-migration", "invalidate-ephemeral-protocol"]}, "migrationId": {"type": ["string", "null"]}, "targets": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/path"}}, "writes": {"type": "boolean"}, "semanticImpact": {"enum": ["none", "managed-rendering", "store-structure", "protocol-artifact-invalidation"]}}}
31
+ }
32
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:project-status:1",
4
+ "title": "Frontend Project Context Project Status",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "package", "initialization", "project", "snapshots", "health", "entry", "summary", "findingCodes", "sourceIds", "itemIds", "projectionPaths", "readTargets", "workUnits", "nextActions", "boundaries"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "package": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["name", "version"],
14
+ "properties": { "name": { "const": "frontend-project-context" }, "version": { "type": "string" } }
15
+ },
16
+ "initialization": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["state", "present", "missing"],
20
+ "properties": {
21
+ "state": { "enum": ["uninitialized", "partial", "invalid", "initialized"] },
22
+ "present": { "$ref": "#/$defs/strings" },
23
+ "missing": { "$ref": "#/$defs/strings" }
24
+ }
25
+ },
26
+ "project": { "anyOf": [{ "type": "null" }, { "$ref": "#/$defs/project" }] },
27
+ "snapshots": { "anyOf": [{ "type": "null" }, { "$ref": "#/$defs/snapshots" }] },
28
+ "health": { "enum": ["uninitialized", "partial", "invalid", "attention", "clean", "conflict"] },
29
+ "entry": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["state", "path", "rendererVersion"],
33
+ "properties": {
34
+ "state": { "enum": ["absent", "current", "stale", "conflict"] },
35
+ "path": { "type": ["string", "null"] },
36
+ "rendererVersion": { "type": ["integer", "null"] }
37
+ }
38
+ },
39
+ "summary": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["findings", "changedSources", "pendingItems", "affectedProjections"],
43
+ "properties": {
44
+ "findings": { "type": "integer", "minimum": 0 },
45
+ "changedSources": { "type": "integer", "minimum": 0 },
46
+ "pendingItems": { "type": "integer", "minimum": 0 },
47
+ "affectedProjections": { "type": "integer", "minimum": 0 }
48
+ }
49
+ },
50
+ "findingCodes": { "$ref": "#/$defs/strings" },
51
+ "sourceIds": { "$ref": "#/$defs/strings" },
52
+ "itemIds": { "$ref": "#/$defs/strings" },
53
+ "projectionPaths": { "$ref": "#/$defs/strings" },
54
+ "readTargets": { "type": "array", "items": { "type": "object" } },
55
+ "workUnits": { "type": "array", "items": { "type": "object" } },
56
+ "nextActions": {
57
+ "type": "array",
58
+ "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
+ },
61
+ "boundaries": { "type": "object", "additionalProperties": { "const": false } }
62
+ },
63
+ "$defs": {
64
+ "strings": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
65
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
66
+ "project": {
67
+ "type": "object", "additionalProperties": false, "required": ["id", "name"],
68
+ "properties": { "id": { "type": "string" }, "name": { "type": "string" } }
69
+ },
70
+ "snapshots": {
71
+ "type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"],
72
+ "properties": { "contract": { "$ref": "#/$defs/digest" }, "sourcesLock": { "$ref": "#/$defs/digest" }, "projectionsLock": { "$ref": "#/$defs/digest" } }
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:projection-lock:2",
4
+ "title": "Frontend Project Context Projection Lock",
5
+ "oneOf": [
6
+ { "$ref": "#/$defs/schema1" },
7
+ { "$ref": "#/$defs/schema2" }
8
+ ],
9
+ "$defs": {
10
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
11
+ "fileEntry1": {
12
+ "type": "object", "additionalProperties": false,
13
+ "required": ["path", "target", "paths", "contractDigest", "bundleDigest", "contentDigest", "itemIds", "rendererVersion"],
14
+ "properties": {
15
+ "path": { "type": "string" }, "target": { "enum": ["agents", "ruler"] }, "paths": { "type": "array", "items": { "type": "string" } },
16
+ "contractDigest": { "$ref": "#/$defs/digest" }, "bundleDigest": { "$ref": "#/$defs/digest" }, "contentDigest": { "$ref": "#/$defs/digest" },
17
+ "itemIds": { "type": "array", "items": { "type": "string" } }, "rendererVersion": { "enum": [1, 2, 3] }
18
+ }
19
+ },
20
+ "fileEntry2": {
21
+ "type": "object", "additionalProperties": false,
22
+ "required": ["path", "target", "ownership", "paths", "contractDigest", "bundleDigest", "contentDigest", "itemIds", "rendererVersion"],
23
+ "properties": {
24
+ "path": { "type": "string" }, "target": { "enum": ["agents", "ruler"] }, "ownership": { "const": "file" },
25
+ "paths": { "type": "array", "items": { "type": "string" } }, "contractDigest": { "$ref": "#/$defs/digest" },
26
+ "bundleDigest": { "$ref": "#/$defs/digest" }, "contentDigest": { "$ref": "#/$defs/digest" },
27
+ "itemIds": { "type": "array", "items": { "type": "string" } }, "rendererVersion": { "enum": [1, 2, 3] }
28
+ }
29
+ },
30
+ "regionEntry": {
31
+ "type": "object", "additionalProperties": false,
32
+ "required": ["path", "target", "ownership", "regionId", "regionDigest", "rendererVersion", "createdFile"],
33
+ "properties": {
34
+ "path": { "type": "string" }, "target": { "const": "ai-entry" }, "ownership": { "const": "region" },
35
+ "regionId": { "const": "project-context-ai-entry" }, "regionDigest": { "$ref": "#/$defs/digest" },
36
+ "rendererVersion": { "enum": [1, 2, 3] }, "createdFile": { "type": "boolean" }
37
+ }
38
+ },
39
+ "schema1": {
40
+ "type": "object", "additionalProperties": false, "required": ["schemaVersion", "projections"],
41
+ "properties": { "schemaVersion": { "const": 1 }, "projections": { "type": "array", "items": { "$ref": "#/$defs/fileEntry1" } } }
42
+ },
43
+ "schema2": {
44
+ "type": "object", "additionalProperties": false, "required": ["schemaVersion", "projections"],
45
+ "properties": { "schemaVersion": { "const": 2 }, "projections": { "type": "array", "items": { "oneOf": [{ "$ref": "#/$defs/fileEntry2" }, { "$ref": "#/$defs/regionEntry" }] } } }
46
+ }
47
+ }
48
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:frontend-project-context:schema:review-bundle:1",
3
+ "$id": "urn:frontend-project-context:schema:review-bundle:2",
4
4
  "title": "Frontend Project Context Review Bundle",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": ["schemaVersion", "projectId", "planDigest", "baselines", "status", "summary", "actions", "groups", "findings", "invocations"],
8
8
  "properties": {
9
- "schemaVersion": { "const": 1 },
9
+ "schemaVersion": { "const": 2 },
10
10
  "projectId": { "$ref": "#/$defs/id" },
11
11
  "planDigest": { "$ref": "#/$defs/digest" },
12
12
  "baselines": { "$ref": "#/$defs/baselines" },
@@ -84,7 +84,7 @@
84
84
  }
85
85
  },
86
86
  "actionKind": {
87
- "enum": ["accept-source-change", "deprecate-item", "deprecate-source", "propose-item", "publish-projection", "register-source", "request-item-approval", "revise-item"]
87
+ "enum": ["accept-source-change", "deprecate-item", "deprecate-source", "propose-item", "publish-ai-entry", "publish-projection", "register-source", "remove-ai-entry", "request-item-approval", "revise-item"]
88
88
  },
89
89
  "invocation": {
90
90
  "type": "object",
@@ -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
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:truth-reconciliation-input:2",
4
+ "title": "Frontend Project Context Truth Reconciliation Input",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "projectId", "current", "task", "candidates", "globalFindings", "resolutionAttempt"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 2 },
10
+ "kind": { "const": "truth-reconciliation-input" },
11
+ "projectId": { "$ref": "#/$defs/id" },
12
+ "current": { "$ref": "#/$defs/current" },
13
+ "task": { "$ref": "#/$defs/task" },
14
+ "candidates": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/candidate" } },
15
+ "globalFindings": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/globalFinding" } },
16
+ "resolutionAttempt": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/resolutionAttempt" }] }
17
+ },
18
+ "$defs": {
19
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$" },
20
+ "text": { "type": "string", "minLength": 1 },
21
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
22
+ "ids": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
23
+ "paths": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
24
+ "snapshots": { "type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"], "properties": { "contract": { "$ref": "#/$defs/digest" }, "sourcesLock": { "$ref": "#/$defs/digest" }, "projectionsLock": { "$ref": "#/$defs/digest" } } },
25
+ "scope": {
26
+ "oneOf": [
27
+ { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "const": "project" } } },
28
+ { "type": "object", "additionalProperties": false, "required": ["kind", "path"], "properties": { "kind": { "enum": ["path-prefix", "file"] }, "path": { "type": "string", "minLength": 1 } } }
29
+ ]
30
+ },
31
+ "scopes": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/scope" } },
32
+ "itemKind": { "enum": ["fact", "policy", "reference", "validation-description"] },
33
+ "classification": { "enum": ["duplicate", "compatible-compose", "scope-split", "supersede", "semantic-conflict", "implementation-only"] },
34
+ "current": {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["revision", "projectSnapshots", "sources", "items"],
38
+ "properties": {
39
+ "revision": { "$ref": "#/$defs/text" },
40
+ "projectSnapshots": { "$ref": "#/$defs/snapshots" },
41
+ "sources": {
42
+ "type": "array", "uniqueItems": true,
43
+ "items": { "type": "object", "additionalProperties": false, "required": ["id", "digest"], "properties": { "id": { "$ref": "#/$defs/id" }, "digest": { "$ref": "#/$defs/digest" } } }
44
+ },
45
+ "items": {
46
+ "type": "array", "uniqueItems": true,
47
+ "items": { "type": "object", "additionalProperties": false, "required": ["id", "digest", "subject", "kind", "scope"], "properties": { "id": { "$ref": "#/$defs/id" }, "digest": { "$ref": "#/$defs/digest" }, "subject": { "$ref": "#/$defs/id" }, "kind": { "$ref": "#/$defs/itemKind" }, "scope": { "$ref": "#/$defs/scope" } } }
48
+ }
49
+ }
50
+ },
51
+ "task": { "type": "object", "additionalProperties": false, "required": ["id", "paths"], "properties": { "id": { "$ref": "#/$defs/id" }, "paths": { "$ref": "#/$defs/paths" } } },
52
+ "sourceChange": { "type": "object", "additionalProperties": false, "required": ["sourceId", "expectedDigest", "candidateDigest", "affectedItemIds", "subjects", "scopes", "classification"], "properties": { "sourceId": { "$ref": "#/$defs/id" }, "expectedDigest": { "$ref": "#/$defs/digest" }, "candidateDigest": { "$ref": "#/$defs/digest" }, "affectedItemIds": { "$ref": "#/$defs/ids" }, "subjects": { "$ref": "#/$defs/ids" }, "scopes": { "$ref": "#/$defs/scopes" }, "classification": { "$ref": "#/$defs/classification" } } },
53
+ "itemChange": { "type": "object", "additionalProperties": false, "required": ["itemId", "expectedDigest", "candidateDigest", "sourceIds", "subject", "kind", "scope", "classification"], "properties": { "itemId": { "$ref": "#/$defs/id" }, "expectedDigest": { "$ref": "#/$defs/digest" }, "candidateDigest": { "$ref": "#/$defs/digest" }, "sourceIds": { "$ref": "#/$defs/ids" }, "subject": { "$ref": "#/$defs/id" }, "kind": { "$ref": "#/$defs/itemKind" }, "scope": { "$ref": "#/$defs/scope" }, "classification": { "$ref": "#/$defs/classification" } } },
54
+ "candidate": { "type": "object", "additionalProperties": false, "required": ["id", "taskId", "lifecycle", "targetStage", "baseRevision", "expectedProjectSnapshots", "currentCodeSnapshotDigest", "currentSourceSnapshotDigest", "currentArtifactDigest", "currentAcceptanceSuiteDigest", "changedPaths", "sourceChanges", "itemChanges", "decisionCandidateIds", "promotionEvidence"], "properties": { "id": { "$ref": "#/$defs/id" }, "taskId": { "$ref": "#/$defs/id" }, "lifecycle": { "enum": ["active", "released", "withdrawn", "rolled-back"] }, "targetStage": { "enum": ["development", "qa", "preproduction", "production"] }, "baseRevision": { "$ref": "#/$defs/text" }, "expectedProjectSnapshots": { "$ref": "#/$defs/snapshots" }, "currentCodeSnapshotDigest": { "$ref": "#/$defs/digest" }, "currentSourceSnapshotDigest": { "$ref": "#/$defs/digest" }, "currentArtifactDigest": { "$ref": "#/$defs/digest" }, "currentAcceptanceSuiteDigest": { "$ref": "#/$defs/digest" }, "changedPaths": { "$ref": "#/$defs/paths" }, "sourceChanges": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/sourceChange" } }, "itemChanges": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/itemChange" } }, "decisionCandidateIds": { "$ref": "#/$defs/ids" }, "promotionEvidence": { "type": "array", "uniqueItems": true, "items": { "$ref": "host-promotion-evidence.schema.json" } } } },
55
+ "globalFinding": { "type": "object", "additionalProperties": false, "required": ["code", "severity", "sourceIds", "itemIds", "subjects", "scopes", "itemKinds"], "properties": { "code": { "$ref": "#/$defs/id" }, "severity": { "enum": ["attention", "conflict", "blocked"] }, "sourceIds": { "$ref": "#/$defs/ids" }, "itemIds": { "$ref": "#/$defs/ids" }, "subjects": { "$ref": "#/$defs/ids" }, "scopes": { "$ref": "#/$defs/scopes" }, "itemKinds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/itemKind" } } } },
56
+ "resolutionKind": { "enum": ["keep-current-baseline", "accept-branch-change", "compose-compatible-changes", "split-scope-or-override", "replace-or-deprecate-source", "fix-source-and-rerun", "refresh-promotion-evidence", "defer-scoped-conflict", "external-implementation-fix-required"] },
57
+ "resolutionDecision": { "type": "object", "additionalProperties": false, "required": ["findingDigest", "resolutionKind", "humanInputs"], "properties": { "findingDigest": { "$ref": "#/$defs/digest" }, "resolutionKind": { "$ref": "#/$defs/resolutionKind" }, "humanInputs": { "type": "object" }, "externalAction": { "type": "object", "additionalProperties": false, "required": ["kind", "completed", "evidenceDigests"], "properties": { "kind": { "$ref": "#/$defs/text" }, "completed": { "type": "boolean" }, "evidenceDigests": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/digest" } } } } } },
58
+ "resolutionAttempt": { "type": "object", "additionalProperties": false, "required": ["previousReviewDigest", "decisions", "projectContextStatus"], "properties": { "previousReviewDigest": { "$ref": "#/$defs/digest" }, "decisions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/resolutionDecision" } }, "projectContextStatus": { "enum": ["clean", "attention", "conflict", "invalid", "partial"] } } }
59
+ }
60
+ }