frontend-project-context 1.8.0 → 1.10.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 (69) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.md +26 -7
  3. package/UPGRADING.md +24 -0
  4. package/docs/00-PRODUCT-CONSTITUTION.md +44 -12
  5. package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +9 -3
  6. package/docs/14-FORMAL-RELEASE-READINESS.md +14 -0
  7. package/docs/28-REAL-PROJECT-ONBOARDING-CLOSURE-DESIGN.md +10 -0
  8. package/docs/29-REAL-PROJECT-1.8.0-INITIALIZATION-OBSERVATIONS.md +228 -0
  9. package/docs/30-TASK-CONTEXT-CONSUMPTION-CLOSURE-DESIGN.md +563 -0
  10. package/docs/31-TASK-CONTEXT-INTEGRITY-REPAIR-DESIGN.md +281 -0
  11. package/docs/32-PROJECT-TO-TASK-INTERACTION-PROPOSAL.md +173 -0
  12. package/docs/33-BOUNDED-TASK-HANDOFF-REDESIGN.md +207 -0
  13. package/docs/34-A0-CODEX-HOST-FEASIBILITY.md +61 -0
  14. package/docs/35-CONTEXT-FIRST-TASK-HANDOFF-DESIGN.md +248 -0
  15. package/docs/36-PRODUCT-VALUE-AND-USABILITY-REVIEW.md +158 -0
  16. package/docs/37-EVERYDAY-HANDOFF-FLOW-DESIGN.md +271 -0
  17. package/docs/38-EVERYDAY-HANDOFF-OPERATION.md +147 -0
  18. package/docs/39-SELF-HOST-RELEASE-ACCEPTANCE.md +39 -0
  19. package/docs/AI-PROJECT-INITIALIZATION.md +8 -3
  20. package/docs/PRODUCT-SHARING-AND-ADOPTION-GUIDE.md +111 -0
  21. package/docs/README.md +26 -2
  22. package/docs/USER-AND-AI-OPERATION-MANUAL.md +9 -3
  23. package/docs/assets/product-sharing-01-overview.svg +32 -0
  24. package/docs/assets/product-sharing-02-how-it-works.svg +17 -0
  25. package/docs/assets/product-sharing-03-example.svg +19 -0
  26. package/examples/package.json +1 -1
  27. package/migration-manifest.json +38 -12
  28. package/package.json +2 -2
  29. package/schemas/capabilities.schema.json +26 -12
  30. package/schemas/context-bundle.schema.json +32 -0
  31. package/schemas/coverage-audit.schema.json +6 -4
  32. package/schemas/evidence-bundle.schema.json +1 -1
  33. package/schemas/initialization-instruction.schema.json +17 -5
  34. package/schemas/migration-manifest.schema.json +3 -3
  35. package/schemas/migration-plan.schema.json +1 -1
  36. package/schemas/project-brief.schema.json +400 -0
  37. package/schemas/projection-lock.schema.json +1 -1
  38. package/schemas/task-context-record.schema.json +27 -0
  39. package/schemas/task-handoff-input.schema.json +23 -0
  40. package/schemas/task-handoff-result.schema.json +320 -0
  41. package/schemas/upgrade-assessment.schema.json +1 -1
  42. package/schemas/upgrade-result-bundle.schema.json +1 -1
  43. package/schemas/work-view.schema.json +541 -0
  44. package/src/project-context/adaptive-context-schema.mjs +1 -1
  45. package/src/project-context/adaptive-context.mjs +16 -29
  46. package/src/project-context/ai-entry.mjs +28 -12
  47. package/src/project-context/approver.mjs +6 -2
  48. package/src/project-context/authoring.mjs +28 -8
  49. package/src/project-context/capabilities.mjs +13 -1
  50. package/src/project-context/checker.mjs +1 -1
  51. package/src/project-context/cli.mjs +74 -17
  52. package/src/project-context/context-bundle.mjs +379 -0
  53. package/src/project-context/contract-schema.mjs +62 -9
  54. package/src/project-context/coverage-profile.mjs +127 -0
  55. package/src/project-context/exchange-schema.mjs +24 -6
  56. package/src/project-context/exchange.mjs +3 -0
  57. package/src/project-context/initialization-instruction.mjs +20 -2
  58. package/src/project-context/maintenance.mjs +5 -4
  59. package/src/project-context/migration-manifest.mjs +3 -3
  60. package/src/project-context/path-policy.mjs +13 -0
  61. package/src/project-context/renderer.mjs +11 -4
  62. package/src/project-context/source-reader.mjs +27 -2
  63. package/src/project-context/task-context.mjs +4 -14
  64. package/src/project-context/task-handoff-schema.mjs +185 -0
  65. package/src/project-context/task-handoff.mjs +259 -0
  66. package/src/project-context/upgrade-schema.mjs +1 -1
  67. package/src/project-context/upgrade.mjs +1 -0
  68. package/src/project-context/work-view-schema.mjs +125 -0
  69. package/src/project-context/work-view.mjs +135 -0
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:context-bundle:1",
4
+ "title": "Frontend Project Context Bundle",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "project", "mode", "task", "snapshots", "semanticCompleteness", "commonItemIds", "targets", "items", "readTargets", "provenanceSources", "coverage", "authority", "gaps", "nextActions", "content", "bundleDigest"],
8
+ "properties": {
9
+ "schemaVersion": {"const": 1},
10
+ "kind": {"const": "context-bundle"},
11
+ "project": {"type": "object", "additionalProperties": false, "required": ["id", "name"], "properties": {"id": {"type": "string", "minLength": 1}, "name": {"type": "string", "minLength": 1}}},
12
+ "mode": {"enum": ["locate", "targeted"]},
13
+ "task": {"type": "object", "additionalProperties": false, "required": ["text", "paths"], "properties": {"text": {"type": "string"}, "paths": {"$ref": "#/$defs/strings"}}},
14
+ "snapshots": {"type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"], "properties": {"contract": {"$ref": "#/$defs/digest"}, "sourcesLock": {"$ref": "#/$defs/digest"}, "projectionsLock": {"$ref": "#/$defs/digest"}}},
15
+ "semanticCompleteness": {"const": "not-claimed"},
16
+ "commonItemIds": {"$ref": "#/$defs/strings"},
17
+ "targets": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "scopeCoverage", "itemIds", "scopedItemIds", "deltaItemIds"], "properties": {"path": {"type": "string"}, "scopeCoverage": {"enum": ["scoped", "project-only", "none"]}, "itemIds": {"$ref": "#/$defs/strings"}, "scopedItemIds": {"$ref": "#/$defs/strings"}, "deltaItemIds": {"$ref": "#/$defs/strings"}}}},
18
+ "items": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["id", "kind", "subject", "scope", "sourceIds", "statement", "value", "overrides"], "properties": {"id": {"type": "string", "minLength": 1}, "kind": {"enum": ["fact", "policy", "reference", "validation-description"]}, "subject": {"type": "string", "minLength": 1}, "scope": {"type": "object", "additionalProperties": false, "required": ["kind"], "properties": {"kind": {"enum": ["project", "path-prefix", "file"]}, "path": {"type": "string"}}}, "sourceIds": {"$ref": "#/$defs/strings"}, "statement": {"type": "string", "minLength": 1}, "value": true, "overrides": {"$ref": "#/$defs/strings"}, "verification": {"type": "object", "additionalProperties": false, "required": ["kind"], "properties": {"kind": {"enum": ["none", "file-exists", "json-value", "path-digest"]}, "source": {"type": "string"}, "expected": true}}, "consumption": {"type": "object", "additionalProperties": false, "required": ["requiredSources", "conditionalSources"], "properties": {"requiredSources": {"$ref": "#/$defs/strings"}, "conditionalSources": {"$ref": "#/$defs/strings"}}}}}},
19
+ "readTargets": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "role", "itemIds", "sourceIds", "reasons"], "properties": {"path": {"type": "string"}, "role": {"enum": ["required", "conditional"]}, "itemIds": {"$ref": "#/$defs/strings"}, "sourceIds": {"$ref": "#/$defs/strings"}, "reasons": {"$ref": "#/$defs/strings"}, "pointers": {"$ref": "#/$defs/strings"}}}},
20
+ "provenanceSources": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["sourceId", "itemIds", "kind", "locator"], "properties": {"sourceId": {"type": "string"}, "itemIds": {"$ref": "#/$defs/strings"}, "kind": {"type": "string"}, "locator": {"type": "object"}}}},
21
+ "coverage": {"type": "object", "additionalProperties": false, "required": ["profileItemId", "profileVersion", "registrationCoverage", "targets", "guarantee"], "properties": {"profileItemId": {"type": ["string", "null"]}, "profileVersion": {"enum": [null, 1, 2]}, "registrationCoverage": {"enum": ["not-declared", "review-required", "unresolved", "closed-for-declared-scope"]}, "targets": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "disposition", "domainId"], "properties": {"path": {"type": "string"}, "disposition": {"enum": ["contract-covered", "dynamic-investigation", "excluded-approved", "unresolved", "outside-declared-coverage"]}, "domainId": {"type": ["string", "null"]}}}}, "guarantee": {"const": "declared-scope-only-never-all-project-truth"}}},
22
+ "authority": {"type": "object", "additionalProperties": false, "required": ["productTaskExecution", "productBusinessCodeWrites", "hostTaskAuthority", "resolveFrom"], "properties": {"productTaskExecution": {"const": false}, "productBusinessCodeWrites": {"const": false}, "hostTaskAuthority": {"const": "external-to-project-context"}, "resolveFrom": {"const": ["current-user-request", "human-authored-project-instructions", "higher-priority-safety-constraints"]}}},
23
+ "gaps": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["code"], "properties": {"code": {"enum": ["target-path-not-yet-known", "project-scope-only", "no-applicable-contract-item", "registration-coverage-not-declared", "registration-coverage-review-required", "required-read-target-unavailable"]}, "path": {"type": "string"}, "sourceIds": {"$ref": "#/$defs/strings"}, "reason": {"type": "string"}, "disposition": {"enum": ["unresolved"]}}}},
24
+ "nextActions": {"$ref": "#/$defs/strings"},
25
+ "content": {"type": "string", "minLength": 1},
26
+ "bundleDigest": {"$ref": "#/$defs/digest"}
27
+ },
28
+ "$defs": {
29
+ "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
30
+ "strings": {"type": "array", "uniqueItems": true, "items": {"type": "string"}}
31
+ }
32
+ }
@@ -1,25 +1,27 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:frontend-project-context:schema:coverage-audit:1",
3
+ "$id": "urn:frontend-project-context:schema:coverage-audit:2",
4
4
  "title": "Frontend Project Context Coverage Audit",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": ["schemaVersion", "kind", "project", "snapshots", "profile", "registrationCoverage", "categories", "guarantee", "auditDigest"],
8
8
  "properties": {
9
- "schemaVersion": { "const": 1 },
9
+ "schemaVersion": { "const": 2 },
10
10
  "kind": { "const": "coverage-audit" },
11
11
  "project": { "type": "object", "additionalProperties": false, "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } },
12
12
  "snapshots": { "$ref": "context-query.schema.json#/$defs/snapshots" },
13
13
  "profile": { "type": ["object", "null"] },
14
- "registrationCoverage": { "enum": ["not-declared", "review-required", "closed-for-declared-scope"] },
14
+ "registrationCoverage": { "enum": ["not-declared", "review-required", "unresolved", "closed-for-declared-scope"] },
15
15
  "categories": {
16
16
  "type": "object",
17
17
  "additionalProperties": false,
18
- "required": ["registered", "excluded-approved", "review-required", "outside-declared-coverage"],
18
+ "required": ["registered", "dynamic-investigation", "excluded-approved", "review-required", "unresolved", "outside-declared-coverage"],
19
19
  "properties": {
20
20
  "registered": { "$ref": "#/$defs/candidates" },
21
+ "dynamic-investigation": { "$ref": "#/$defs/candidates" },
21
22
  "excluded-approved": { "$ref": "#/$defs/candidates" },
22
23
  "review-required": { "$ref": "#/$defs/candidates" },
24
+ "unresolved": { "$ref": "#/$defs/candidates" },
23
25
  "outside-declared-coverage": { "$ref": "#/$defs/candidates" }
24
26
  }
25
27
  },
@@ -14,7 +14,7 @@
14
14
  "required": ["name", "version", "exchangeProtocolVersion"],
15
15
  "properties": {
16
16
  "name": { "const": "frontend-project-context" },
17
- "version": { "const": "1.8.0" },
17
+ "version": { "const": "1.10.0" },
18
18
  "exchangeProtocolVersion": { "const": 6 }
19
19
  }
20
20
  },
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:frontend-project-context:schema:initialization-instruction:1",
3
+ "$id": "urn:frontend-project-context:schema:initialization-instruction:2",
4
4
  "title": "Frontend Project Context Initialization Instruction",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["schemaVersion", "package", "instruction", "targetRoot", "boundaries"],
7
+ "required": ["schemaVersion", "package", "instruction", "targetRoot", "boundaries", "entryRuleReview"],
8
8
  "properties": {
9
- "schemaVersion": {"const": 1},
9
+ "schemaVersion": {"const": 2},
10
10
  "package": {
11
11
  "type": "object",
12
12
  "additionalProperties": false,
13
13
  "required": ["name", "version"],
14
14
  "properties": {
15
15
  "name": {"const": "frontend-project-context"},
16
- "version": {"const": "1.8.0"}
16
+ "version": {"const": "1.10.0"}
17
17
  }
18
18
  },
19
19
  "instruction": {
@@ -22,13 +22,25 @@
22
22
  "required": ["id", "version", "packagePath", "digest", "content"],
23
23
  "properties": {
24
24
  "id": {"const": "ai-project-initialization"},
25
- "version": {"const": 1},
25
+ "version": {"const": 2},
26
26
  "packagePath": {"const": "docs/AI-PROJECT-INITIALIZATION.md"},
27
27
  "digest": {"$ref": "#/$defs/digest"},
28
28
  "content": {"type": "string", "minLength": 1}
29
29
  }
30
30
  },
31
31
  "targetRoot": {"type": "string", "minLength": 1},
32
+ "entryRuleReview": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["path", "present", "allowedDispositions", "records", "automaticDeletion"],
36
+ "properties": {
37
+ "path": {"const": "AGENTS.md"},
38
+ "present": {"type": "boolean"},
39
+ "allowedDispositions": {"const": ["migrated-to-contract", "kept-in-entry-intentionally", "excluded-as-stale", "unresolved-blocker"]},
40
+ "records": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["id", "disposition", "rationale"], "properties": {"id": {"type": "string"}, "disposition": {"enum": ["migrated-to-contract", "kept-in-entry-intentionally", "excluded-as-stale", "unresolved-blocker"]}, "rationale": {"type": "string"}}}},
41
+ "automaticDeletion": {"const": false}
42
+ }
43
+ },
32
44
  "boundaries": {
33
45
  "type": "object",
34
46
  "additionalProperties": false,
@@ -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.8.0"}}},
11
- "upgradeFrom": {"const": ["1.3.1", "1.4.0", "1.5.0", "1.6.0", "1.7.0"]},
10
+ "package": {"type": "object", "additionalProperties": false, "required": ["name", "version"], "properties": {"name": {"const": "frontend-project-context"}, "version": {"const": "1.10.0"}}},
11
+ "upgradeFrom": {"const": ["1.3.1", "1.4.0", "1.5.0", "1.6.0", "1.7.0", "1.8.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": 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"}}}},
15
+ "paths": {"type": "array", "minItems": 6, "maxItems": 6, "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", "1.8.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"},
@@ -9,7 +9,7 @@
9
9
  "schemaVersion": {"const": 1},
10
10
  "kind": {"const": "target-upgrade-plan"},
11
11
  "fromVersion": {"enum": ["1.3.1", "1.4.0", "1.5.0", "1.6.0", "1.7.0"]},
12
- "targetVersion": {"const": "1.8.0"},
12
+ "targetVersion": {"const": "1.10.0"},
13
13
  "manifestDigest": {"$ref": "#/$defs/digest"},
14
14
  "assessmentDigest": {"$ref": "#/$defs/digest"},
15
15
  "snapshots": {"anyOf": [{"type": "null"}, {"$ref": "#/$defs/snapshots"}]},
@@ -0,0 +1,400 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:project-brief:2",
4
+ "oneOf": [
5
+ {
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "kind",
11
+ "project",
12
+ "package",
13
+ "connection",
14
+ "projectHealth",
15
+ "contractReadiness",
16
+ "findingCodes",
17
+ "taskStatus",
18
+ "tasks",
19
+ "nextAction",
20
+ "authorityGranted"
21
+ ],
22
+ "properties": {
23
+ "schemaVersion": {
24
+ "const": 1
25
+ },
26
+ "kind": {
27
+ "const": "project-brief"
28
+ },
29
+ "project": {
30
+ "anyOf": [
31
+ {
32
+ "type": "object"
33
+ },
34
+ {
35
+ "type": "null"
36
+ }
37
+ ]
38
+ },
39
+ "package": {
40
+ "type": "object"
41
+ },
42
+ "connection": {
43
+ "enum": [
44
+ "available",
45
+ "needs-governance",
46
+ "not-connected"
47
+ ]
48
+ },
49
+ "projectHealth": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "contractReadiness": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "findingCodes": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "string",
61
+ "minLength": 1
62
+ }
63
+ },
64
+ "taskStatus": {
65
+ "const": "none"
66
+ },
67
+ "tasks": {
68
+ "type": "array",
69
+ "items": {
70
+ "oneOf": [
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": [
75
+ "taskId",
76
+ "title",
77
+ "lifecycle",
78
+ "readPaths",
79
+ "writePaths",
80
+ "unresolvedDecisions"
81
+ ],
82
+ "properties": {
83
+ "taskId": {
84
+ "type": "string",
85
+ "minLength": 1
86
+ },
87
+ "title": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ },
91
+ "lifecycle": {
92
+ "enum": [
93
+ "active",
94
+ "completed",
95
+ "cancelled"
96
+ ]
97
+ },
98
+ "readPaths": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "string",
102
+ "minLength": 1
103
+ }
104
+ },
105
+ "writePaths": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "string",
109
+ "minLength": 1
110
+ }
111
+ },
112
+ "unresolvedDecisions": {
113
+ "type": "integer",
114
+ "minimum": 0
115
+ }
116
+ }
117
+ },
118
+ {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": [
122
+ "path",
123
+ "status"
124
+ ],
125
+ "properties": {
126
+ "path": {
127
+ "type": "string",
128
+ "minLength": 1
129
+ },
130
+ "status": {
131
+ "const": "invalid-record"
132
+ },
133
+ "reason": {
134
+ "type": "string",
135
+ "minLength": 1
136
+ }
137
+ }
138
+ }
139
+ ]
140
+ }
141
+ },
142
+ "nextAction": {
143
+ "type": "string",
144
+ "minLength": 1
145
+ },
146
+ "authorityGranted": {
147
+ "const": false
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "schemaVersion",
156
+ "kind",
157
+ "project",
158
+ "package",
159
+ "connection",
160
+ "projectHealth",
161
+ "contractReadiness",
162
+ "findingCodes",
163
+ "taskStatus",
164
+ "tasks",
165
+ "nextAction",
166
+ "authorityGranted",
167
+ "context",
168
+ "overview",
169
+ "presentation",
170
+ "delivery"
171
+ ],
172
+ "properties": {
173
+ "schemaVersion": {
174
+ "const": 2
175
+ },
176
+ "kind": {
177
+ "const": "project-brief"
178
+ },
179
+ "project": {
180
+ "anyOf": [
181
+ {
182
+ "type": "object"
183
+ },
184
+ {
185
+ "type": "null"
186
+ }
187
+ ]
188
+ },
189
+ "package": {
190
+ "type": "object"
191
+ },
192
+ "connection": {
193
+ "enum": [
194
+ "available",
195
+ "needs-governance",
196
+ "not-connected"
197
+ ]
198
+ },
199
+ "projectHealth": {
200
+ "type": "string",
201
+ "minLength": 1
202
+ },
203
+ "contractReadiness": {
204
+ "type": "string",
205
+ "minLength": 1
206
+ },
207
+ "findingCodes": {
208
+ "type": "array",
209
+ "items": {
210
+ "type": "string",
211
+ "minLength": 1
212
+ }
213
+ },
214
+ "taskStatus": {
215
+ "const": "none"
216
+ },
217
+ "tasks": {
218
+ "type": "array",
219
+ "items": {
220
+ "oneOf": [
221
+ {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": [
225
+ "taskId",
226
+ "title",
227
+ "lifecycle",
228
+ "readPaths",
229
+ "writePaths",
230
+ "unresolvedDecisions",
231
+ "progressSummary"
232
+ ],
233
+ "properties": {
234
+ "taskId": {
235
+ "type": "string",
236
+ "minLength": 1
237
+ },
238
+ "title": {
239
+ "type": "string",
240
+ "minLength": 1
241
+ },
242
+ "lifecycle": {
243
+ "enum": [
244
+ "active",
245
+ "completed",
246
+ "cancelled"
247
+ ]
248
+ },
249
+ "readPaths": {
250
+ "type": "array",
251
+ "items": {
252
+ "type": "string",
253
+ "minLength": 1
254
+ }
255
+ },
256
+ "writePaths": {
257
+ "type": "array",
258
+ "items": {
259
+ "type": "string",
260
+ "minLength": 1
261
+ }
262
+ },
263
+ "unresolvedDecisions": {
264
+ "type": "integer",
265
+ "minimum": 0
266
+ },
267
+ "progressSummary": {
268
+ "$ref": "work-view.schema.json#/$defs/progress"
269
+ }
270
+ }
271
+ },
272
+ {
273
+ "type": "object",
274
+ "additionalProperties": false,
275
+ "required": [
276
+ "path",
277
+ "status"
278
+ ],
279
+ "properties": {
280
+ "path": {
281
+ "type": "string",
282
+ "minLength": 1
283
+ },
284
+ "status": {
285
+ "const": "invalid-record"
286
+ },
287
+ "reason": {
288
+ "type": "string",
289
+ "minLength": 1
290
+ }
291
+ }
292
+ }
293
+ ]
294
+ }
295
+ },
296
+ "nextAction": {
297
+ "type": "string",
298
+ "minLength": 1
299
+ },
300
+ "authorityGranted": {
301
+ "const": false
302
+ },
303
+ "context": {
304
+ "anyOf": [
305
+ {
306
+ "$ref": "context-bundle.schema.json"
307
+ },
308
+ {
309
+ "type": "null"
310
+ }
311
+ ]
312
+ },
313
+ "overview": {
314
+ "type": "object",
315
+ "additionalProperties": false,
316
+ "required": [
317
+ "items",
318
+ "scopeSummary",
319
+ "limitations"
320
+ ],
321
+ "properties": {
322
+ "items": {
323
+ "type": "array",
324
+ "maxItems": 5,
325
+ "items": {
326
+ "$ref": "work-view.schema.json#/$defs/item"
327
+ }
328
+ },
329
+ "scopeSummary": {
330
+ "type": "array",
331
+ "items": {
332
+ "type": "object",
333
+ "additionalProperties": false,
334
+ "required": [
335
+ "scope",
336
+ "items"
337
+ ],
338
+ "properties": {
339
+ "scope": {
340
+ "oneOf": [
341
+ {
342
+ "type": "object",
343
+ "additionalProperties": false,
344
+ "required": [
345
+ "kind"
346
+ ],
347
+ "properties": {
348
+ "kind": {
349
+ "const": "project"
350
+ }
351
+ }
352
+ },
353
+ {
354
+ "type": "object",
355
+ "additionalProperties": false,
356
+ "required": [
357
+ "kind",
358
+ "path"
359
+ ],
360
+ "properties": {
361
+ "kind": {
362
+ "enum": [
363
+ "path-prefix",
364
+ "file"
365
+ ]
366
+ },
367
+ "path": {
368
+ "type": "string",
369
+ "minLength": 1
370
+ }
371
+ }
372
+ }
373
+ ]
374
+ },
375
+ "items": {
376
+ "type": "integer",
377
+ "minimum": 1
378
+ }
379
+ }
380
+ }
381
+ },
382
+ "limitations": {
383
+ "type": "array",
384
+ "items": {
385
+ "type": "string",
386
+ "minLength": 1
387
+ }
388
+ }
389
+ }
390
+ },
391
+ "presentation": {
392
+ "$ref": "work-view.schema.json#/$defs/presentation"
393
+ },
394
+ "delivery": {
395
+ "$ref": "work-view.schema.json#/$defs/delivery"
396
+ }
397
+ }
398
+ }
399
+ ]
400
+ }
@@ -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": { "enum": [1, 2, 3] }, "createdFile": { "type": "boolean" }
36
+ "rendererVersion": { "enum": [1, 2, 3, 4, 5, 6, 7] }, "createdFile": { "type": "boolean" }
37
37
  }
38
38
  },
39
39
  "schema1": {
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:task-context-record:1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schemaVersion", "kind", "projectId", "taskId", "title", "revision", "previousDigest", "origin", "lifecycle", "scope", "requirements", "evidence", "decisions", "progress"],
7
+ "properties": {
8
+ "schemaVersion": {"const": 1}, "kind": {"const": "task-context-record"},
9
+ "projectId": {"type": "string", "minLength": 1},
10
+ "taskId": {"$ref": "#/$defs/id"}, "title": {"type": "string", "minLength": 1},
11
+ "revision": {"type": "integer", "minimum": 1},
12
+ "previousDigest": {"anyOf": [{"type": "null"}, {"$ref": "#/$defs/digest"}]},
13
+ "origin": {"type": "object", "additionalProperties": false, "required": ["text"], "properties": {"text": {"type": "string", "minLength": 1}, "reference": {"type": "string", "minLength": 1}}},
14
+ "lifecycle": {"enum": ["active", "completed", "cancelled"]},
15
+ "scope": {"type": "object", "additionalProperties": false, "required": ["readPaths", "writeTargets"], "properties": {"readPaths": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/path"}}, "writeTargets": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "operation"], "properties": {"path": {"$ref": "#/$defs/path"}, "operation": {"enum": ["create", "modify", "delete"]}}}}, "workspaceLabel": {"type": "string", "minLength": 1}}},
16
+ "requirements": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["id", "text", "source", "appliesTo", "blocking", "evidenceIds"], "properties": {"id": {"$ref": "#/$defs/id"}, "text": {"type": "string", "minLength": 1}, "source": {"type": "string", "minLength": 1}, "appliesTo": {"$ref": "#/$defs/appliesTo"}, "blocking": {"type": "boolean"}, "evidenceIds": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/id"}}}}},
17
+ "evidence": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["id", "purpose", "kind", "digest", "identity"], "properties": {"id": {"$ref": "#/$defs/id"}, "purpose": {"enum": ["requirement", "design", "decision", "implementation", "reference"]}, "kind": {"enum": ["local", "inline", "external"]}, "path": {"$ref": "#/$defs/path"}, "text": {"type": "string", "minLength": 1}, "reference": {"type": "string", "minLength": 1}, "digest": {"$ref": "#/$defs/digest"}, "identity": {"enum": ["local-verified", "user-statement", "host-asserted"]}}}},
18
+ "decisions": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["id", "question", "appliesTo", "blocking", "status", "evidenceIds"], "properties": {"id": {"$ref": "#/$defs/id"}, "question": {"type": "string", "minLength": 1}, "appliesTo": {"$ref": "#/$defs/appliesTo"}, "blocking": {"type": "boolean"}, "status": {"enum": ["open", "confirmed"]}, "value": {"type": "string", "minLength": 1}, "evidenceIds": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/id"}}}}},
19
+ "progress": {"type": "object", "additionalProperties": false, "required": ["completed", "remaining", "implementation", "nextAction"], "properties": {"completed": {"type": "array", "items": {"type": "string", "minLength": 1}}, "remaining": {"type": "array", "items": {"type": "string", "minLength": 1}}, "implementation": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "operation", "status", "digest"], "properties": {"path": {"$ref": "#/$defs/path"}, "operation": {"enum": ["create", "modify", "delete"]}, "status": {"const": "completed"}, "digest": {"$ref": "#/$defs/digest"}}}}, "nextAction": {"type": "string", "minLength": 1}}}
20
+ },
21
+ "$defs": {
22
+ "id": {"type": "string", "maxLength": 64, "pattern": "^[a-z0-9]+([.-][a-z0-9]+)*$"},
23
+ "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
24
+ "path": {"type": "string", "minLength": 1},
25
+ "appliesTo": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"enum": ["investigate", "design", "implement"]}}
26
+ }
27
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:task-handoff-input:1",
4
+ "type": "object", "additionalProperties": false,
5
+ "required": ["schemaVersion", "kind", "intent", "consumerRunId"],
6
+ "oneOf": [{"required": ["recordPath"], "not": {"required": ["record"]}}, {"required": ["record"], "not": {"required": ["recordPath"]}}],
7
+ "properties": {
8
+ "schemaVersion": {"const": 1}, "kind": {"const": "task-handoff-input"},
9
+ "recordPath": {"type": "string", "pattern": "^\\.project-context-tasks/[a-z0-9][a-z0-9.-]*\\.json$"},
10
+ "record": {"$ref": "task-context-record.schema.json"},
11
+ "intent": {"enum": ["investigate", "design", "implement"]},
12
+ "consumerRunId": {"type": "string", "minLength": 1},
13
+ "consumption": {"type": "object", "additionalProperties": false, "required": ["contextBundleDigest", "consumerRunId", "readTargets", "evidenceIds", "conditional"], "properties": {
14
+ "contextBundleDigest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
15
+ "taskId": {"$ref": "task-context-record.schema.json#/$defs/id"},
16
+ "requirementsDigest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
17
+ "consumerRunId": {"type": "string", "minLength": 1},
18
+ "readTargets": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "digest"], "properties": {"path": {"type": "string"}, "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"}}}},
19
+ "evidenceIds": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
20
+ "conditional": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["path", "decision", "reason"], "properties": {"path": {"type": "string"}, "decision": {"enum": ["read", "not-applicable"]}, "reason": {"type": "string", "minLength": 1}, "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"}}, "allOf": [{"if": {"properties": {"decision": {"const": "read"}}}, "then": {"required": ["digest"]}, "else": {"not": {"required": ["digest"]}}}]}}
21
+ }}
22
+ }
23
+ }