@davidorex/pi-context 0.31.0 → 0.33.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.
- package/CHANGELOG.md +73 -0
- package/README.md +16 -14
- package/dist/block-api.d.ts +20 -33
- package/dist/block-api.d.ts.map +1 -1
- package/dist/block-api.js +154 -3
- package/dist/block-api.js.map +1 -1
- package/dist/content-hash.d.ts +9 -0
- package/dist/content-hash.d.ts.map +1 -1
- package/dist/content-hash.js +11 -0
- package/dist/content-hash.js.map +1 -1
- package/dist/context-sdk.d.ts +157 -39
- package/dist/context-sdk.d.ts.map +1 -1
- package/dist/context-sdk.js +896 -251
- package/dist/context-sdk.js.map +1 -1
- package/dist/context.d.ts +158 -5
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +75 -5
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +151 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +590 -97
- package/dist/index.js.map +1 -1
- package/dist/lens-view.d.ts +0 -5
- package/dist/lens-view.d.ts.map +1 -1
- package/dist/lens-view.js +43 -1
- package/dist/lens-view.js.map +1 -1
- package/dist/migration-registry-loader.d.ts +20 -12
- package/dist/migration-registry-loader.d.ts.map +1 -1
- package/dist/migration-registry-loader.js +46 -17
- package/dist/migration-registry-loader.js.map +1 -1
- package/dist/migrations-store.d.ts +45 -18
- package/dist/migrations-store.d.ts.map +1 -1
- package/dist/migrations-store.js +56 -22
- package/dist/migrations-store.js.map +1 -1
- package/dist/ops-registry.d.ts +18 -0
- package/dist/ops-registry.d.ts.map +1 -1
- package/dist/ops-registry.js +474 -130
- package/dist/ops-registry.js.map +1 -1
- package/dist/promote-item.d.ts.map +1 -1
- package/dist/promote-item.js +41 -12
- package/dist/promote-item.js.map +1 -1
- package/dist/roadmap-plan.d.ts +121 -99
- package/dist/roadmap-plan.d.ts.map +1 -1
- package/dist/roadmap-plan.js +281 -345
- package/dist/roadmap-plan.js.map +1 -1
- package/dist/status-vocab.d.ts +12 -2
- package/dist/status-vocab.d.ts.map +1 -1
- package/dist/status-vocab.js +14 -1
- package/dist/status-vocab.js.map +1 -1
- package/package.json +2 -2
- package/samples/blocks/milestone.json +3 -0
- package/samples/blocks/session-notes.json +1 -0
- package/samples/conception.json +315 -15
- package/samples/migrations.json +8 -0
- package/samples/schemas/context-contracts.schema.json +4 -0
- package/samples/schemas/conventions.schema.json +4 -0
- package/samples/schemas/decisions.schema.json +4 -0
- package/samples/schemas/features.schema.json +4 -0
- package/samples/schemas/framework-gaps.schema.json +9 -0
- package/samples/schemas/issues.schema.json +28 -0
- package/samples/schemas/layer-plans.schema.json +4 -0
- package/samples/schemas/milestone.schema.json +79 -0
- package/samples/schemas/phase.schema.json +4 -0
- package/samples/schemas/rationale.schema.json +4 -0
- package/samples/schemas/requirements.schema.json +4 -0
- package/samples/schemas/research.schema.json +45 -2
- package/samples/schemas/session-notes.schema.json +89 -0
- package/samples/schemas/spec-reviews.schema.json +4 -0
- package/samples/schemas/story.schema.json +8 -0
- package/samples/schemas/tasks.schema.json +4 -0
- package/samples/schemas/verification.schema.json +4 -0
- package/samples/schemas/work-orders.schema.json +4 -0
- package/schemas/config.schema.json +90 -4
- package/schemas/migrations.schema.json +25 -0
- package/skill-narrative.md +8 -6
- package/skills/pi-context/SKILL.md +70 -63
- package/skills/pi-context/references/bundled-resources.md +5 -1
package/samples/migrations.json
CHANGED
|
@@ -128,6 +128,14 @@
|
|
|
128
128
|
"kind": "identity",
|
|
129
129
|
"created_by": "human/davidryan@gmail.com",
|
|
130
130
|
"created_at": "2026-05-31T07:48:18.893Z"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"schemaName": "config",
|
|
134
|
+
"fromVersion": "1.0.0",
|
|
135
|
+
"toVersion": "1.8.0",
|
|
136
|
+
"kind": "identity",
|
|
137
|
+
"created_by": "human/davidryan@gmail.com",
|
|
138
|
+
"created_at": "2026-07-02T00:00:00.000Z"
|
|
131
139
|
}
|
|
132
140
|
]
|
|
133
141
|
}
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
],
|
|
11
11
|
"additionalProperties": false,
|
|
12
12
|
"properties": {
|
|
13
|
+
"schema_version": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
16
|
+
},
|
|
13
17
|
"contracts": {
|
|
14
18
|
"type": "array",
|
|
15
19
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"rules"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"rules": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"decisions"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"decisions": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"features"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"features": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"gaps"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"gaps": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -97,6 +101,11 @@
|
|
|
97
101
|
"tokens": 1000,
|
|
98
102
|
"words": 800
|
|
99
103
|
}
|
|
104
|
+
},
|
|
105
|
+
"content_pin": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
108
|
+
"description": "SHA-256 of the referenced file at write time. Stamped by the write path when `file` names a readable file OUTSIDE the substrate dir (substrate-internal paths are living state, never pinned) and no pin exists; context-validate flags a pinned evidence entry whose current file hash drifted (anchor drift — re-review, never rewritten)."
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
111
|
}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"issues"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"issues": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -90,6 +94,10 @@
|
|
|
90
94
|
"type": "string",
|
|
91
95
|
"description": "Commit message or reference if resolved"
|
|
92
96
|
},
|
|
97
|
+
"resolved_at": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "ISO-8601 timestamp when the issue was resolved"
|
|
100
|
+
},
|
|
93
101
|
"oid": {
|
|
94
102
|
"type": "string",
|
|
95
103
|
"pattern": "^[0-9a-f]{32}$",
|
|
@@ -108,5 +116,25 @@
|
|
|
108
116
|
}
|
|
109
117
|
}
|
|
110
118
|
}
|
|
119
|
+
},
|
|
120
|
+
"x-lifecycle": {
|
|
121
|
+
"field": "status",
|
|
122
|
+
"states": [
|
|
123
|
+
"open",
|
|
124
|
+
"resolved",
|
|
125
|
+
"deferred"
|
|
126
|
+
],
|
|
127
|
+
"transitions": [
|
|
128
|
+
{
|
|
129
|
+
"from": "open",
|
|
130
|
+
"to": "resolved",
|
|
131
|
+
"required_authority": "any"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"from": "open",
|
|
135
|
+
"to": "deferred",
|
|
136
|
+
"required_authority": "user"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
111
139
|
}
|
|
112
140
|
}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"plans"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"plans": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "pi-context://schemas/milestone",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"title": "Milestones",
|
|
6
|
+
"description": "Array-block of project milestones. A milestone is a pure phase-rollup checkpoint with no work of its own: its `status` (planned | reached) is DERIVED, never authored — a milestone is `reached` iff at least one phase is positioned in it (a phase_positioned_in_milestone edge) and the parent phase of every such edge buckets to complete, else `planned`. Phase membership lives in relations.json phase_positioned_in_milestone edges (phase -> milestone), not inline. `release` is an optional grouping string pending the normalized release entity.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"milestones"
|
|
10
|
+
],
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"schema_version": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
16
|
+
},
|
|
17
|
+
"milestones": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": [
|
|
23
|
+
"id",
|
|
24
|
+
"name",
|
|
25
|
+
"status"
|
|
26
|
+
],
|
|
27
|
+
"properties": {
|
|
28
|
+
"id": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^MILE-\\d{3,}$",
|
|
31
|
+
"description": "Stable canonical id; MILE-NNN (3+ digits), mirroring the STORY-/TASK-NNN convention."
|
|
32
|
+
},
|
|
33
|
+
"name": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"status": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": [
|
|
39
|
+
"planned",
|
|
40
|
+
"reached"
|
|
41
|
+
],
|
|
42
|
+
"description": "DERIVED phase-rollup, not authored: `reached` iff >=1 phase_positioned_in_milestone edge (in which the phase is the parent and the milestone the child) and the parent phase of every such edge buckets to complete; else `planned`. A milestone carries no work of its own; authored status is rejected by canon (substrate-derived-state)."
|
|
43
|
+
},
|
|
44
|
+
"release": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Optional release grouping label. Interim flat string pending the normalized release entity, which will subsume / edge this field."
|
|
47
|
+
},
|
|
48
|
+
"created_by": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"created_at": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"modified_by": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"modified_at": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"oid": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^[0-9a-f]{32}$",
|
|
63
|
+
"description": "Content-independent substrate-stable item identity (content-addressed substrate identity, Cycle 3). Minted once at item birth via mintOid(substrate_id); immutable across content versions. Optional in the schema so pre-Cycle-3 items validate; stamped on next write."
|
|
64
|
+
},
|
|
65
|
+
"content_hash": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
68
|
+
"description": "SHA-256 (hex) of the RFC-8785-canonical content projection of this item (metadata fields excluded). Recomputed on every stamping write; moves with content, stable across metadata-only churn."
|
|
69
|
+
},
|
|
70
|
+
"content_parent": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
73
|
+
"description": "content_hash of the immediately-prior version of this item; set on a content-changing update, absent on the first (v1) version. Forms the per-item content version chain."
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
],
|
|
11
11
|
"additionalProperties": false,
|
|
12
12
|
"properties": {
|
|
13
|
+
"schema_version": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
16
|
+
},
|
|
13
17
|
"phases": {
|
|
14
18
|
"type": "array",
|
|
15
19
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"rationales"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"rationales": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"requirements"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"requirements": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"research"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"research": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -140,9 +144,43 @@
|
|
|
140
144
|
"stale_conditions": {
|
|
141
145
|
"type": "array",
|
|
142
146
|
"items": {
|
|
143
|
-
"
|
|
147
|
+
"oneOf": [
|
|
148
|
+
{
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": ["kind", "item", "bucket"],
|
|
155
|
+
"properties": {
|
|
156
|
+
"kind": { "const": "item-status" },
|
|
157
|
+
"item": { "type": "string", "description": "Selector of the substrate item whose status this condition watches (a reference predicate, not an embedded entity — deliberately not named 'id')." },
|
|
158
|
+
"bucket": { "type": "string", "description": "Status bucket that fires the condition when the watched item's status maps to it." }
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"type": "object",
|
|
163
|
+
"additionalProperties": false,
|
|
164
|
+
"required": ["kind", "path"],
|
|
165
|
+
"properties": {
|
|
166
|
+
"kind": { "const": "file-changed" },
|
|
167
|
+
"path": { "type": "string", "description": "Project-root-relative path whose content change fires the condition." },
|
|
168
|
+
"baseline_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the file at grounding time. Stamped by the write path when absent and the file is readable; the condition fires when the current hash differs (or the file is gone)." }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"required": ["kind", "ref"],
|
|
175
|
+
"properties": {
|
|
176
|
+
"kind": { "const": "revision-moved" },
|
|
177
|
+
"ref": { "type": "string", "description": "Git ref whose movement fires the condition." },
|
|
178
|
+
"baseline_sha": { "type": "string", "description": "Commit the ref pointed at when grounding was current. Stamped by the write path when absent and the ref resolves; the condition fires when the ref moves." }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
]
|
|
144
182
|
},
|
|
145
|
-
"description": "
|
|
183
|
+
"description": "Conditions under which the research is no longer authoritative. Bare strings are human-judged only. Typed variants are machine-evaluated: context-validate flags a complete item whose condition fired as a staleness candidate, and context-reconcile (or a human) applies the complete-to-stale transition — never silently."
|
|
146
184
|
},
|
|
147
185
|
"citations": {
|
|
148
186
|
"type": "array",
|
|
@@ -168,6 +206,11 @@
|
|
|
168
206
|
},
|
|
169
207
|
"retrieved_at": {
|
|
170
208
|
"type": "string"
|
|
209
|
+
},
|
|
210
|
+
"content_pin": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
213
|
+
"description": "SHA-256 of the cited file at write time. Stamped by the write path when `path` names a readable file OUTSIDE the substrate dir (substrate-internal paths are living state, never pinned) and no pin exists; context-validate flags a pinned citation whose current file hash drifted."
|
|
171
214
|
}
|
|
172
215
|
}
|
|
173
216
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "pi-context://schemas/session-notes",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"title": "Session Notes",
|
|
6
|
+
"description": "Per-session handoff records: focus, discoveries, questions, decisions made, current status, and next steps captured at session end for cross-session continuity.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"sessions"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"schema_version": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"sessions": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"required": [
|
|
22
|
+
"id",
|
|
23
|
+
"timestamp",
|
|
24
|
+
"focus",
|
|
25
|
+
"current_status",
|
|
26
|
+
"next_steps"
|
|
27
|
+
],
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"properties": {
|
|
30
|
+
"id": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "^SESSION-\\d{3}$"
|
|
33
|
+
},
|
|
34
|
+
"timestamp": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "ISO-8601 with local offset"
|
|
37
|
+
},
|
|
38
|
+
"focus": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "1-2 sentence summary of what the session covered"
|
|
41
|
+
},
|
|
42
|
+
"discoveries": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"questions": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"decisions_made": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"current_status": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Prose summary of where the project stands at session end"
|
|
63
|
+
},
|
|
64
|
+
"next_steps": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"oid": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"pattern": "^[0-9a-f]{32}$",
|
|
73
|
+
"description": "Content-independent substrate-stable item identity (content-addressed substrate identity, Cycle 3). Minted once at item birth via mintOid(substrate_id); immutable across content versions. Optional in the schema so pre-Cycle-3 items validate; stamped on next write."
|
|
74
|
+
},
|
|
75
|
+
"content_hash": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
78
|
+
"description": "SHA-256 (hex) of the RFC-8785-canonical content projection of this item (metadata fields excluded). Recomputed on every stamping write; moves with content, stable across metadata-only churn."
|
|
79
|
+
},
|
|
80
|
+
"content_parent": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
83
|
+
"description": "content_hash of the immediately-prior version of this item; set on a content-changing update, absent on the first (v1) version. Forms the per-item content version chain."
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"reviews"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"reviews": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
],
|
|
11
11
|
"additionalProperties": false,
|
|
12
12
|
"properties": {
|
|
13
|
+
"schema_version": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
16
|
+
},
|
|
13
17
|
"stories": {
|
|
14
18
|
"type": "array",
|
|
15
19
|
"items": {
|
|
@@ -29,6 +33,10 @@
|
|
|
29
33
|
"title": {
|
|
30
34
|
"type": "string"
|
|
31
35
|
},
|
|
36
|
+
"user_kind": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Which user the story speaks for (e.g. cli-user, operator, agent) — the 'As a <user_kind>' subject of the story statement."
|
|
39
|
+
},
|
|
32
40
|
"status": {
|
|
33
41
|
"type": "string",
|
|
34
42
|
"enum": [
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"tasks"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"tasks": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"verifications"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
12
|
+
"schema_version": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
15
|
+
},
|
|
12
16
|
"verifications": {
|
|
13
17
|
"type": "array",
|
|
14
18
|
"items": {
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
],
|
|
11
11
|
"additionalProperties": false,
|
|
12
12
|
"properties": {
|
|
13
|
+
"schema_version": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Semver of the block schema this envelope was last written against. Stamped by the write path to the schema's current version; when it differs from the installed schema's version, the read/write gates walk the block through the registered migration chain (or fail loud when no chain reaches the current version). Absent on blocks not yet written by a stamping write path."
|
|
16
|
+
},
|
|
13
17
|
"work_orders": {
|
|
14
18
|
"type": "array",
|
|
15
19
|
"items": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "pi-context://schemas/config",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"title": "pi-context substrate config",
|
|
6
|
-
"description": "Self-bootstrapping config block. Validates the config that configures the substrate. ConfigBlock is the canonical registry for block kinds, status buckets, relation types, display strings, layers, naming aliases, hierarchy declarations, and
|
|
6
|
+
"description": "Self-bootstrapping config block. Validates the config that configures the substrate. ConfigBlock is the canonical registry for block kinds, status buckets, relation types, display strings, layers, naming aliases, hierarchy declarations, lens specs, and the state-derivation registry that drives currentState (focus / in-flight / next-actions / blocked / milestone-rollup).",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"required": ["schema_version", "block_kinds"],
|
|
9
9
|
"additionalProperties": false,
|
|
@@ -67,6 +67,79 @@
|
|
|
67
67
|
"enum": ["complete", "in_progress", "blocked", "todo", "unknown"]
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
+
"state_derivation": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"description": "Config-declared derivation registry for currentState — the kind/relation/rank/status/head-size couplings that previously lived as hardcoded literals in the deriver. A substrate without it reports 'state-derivation not configured'.",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"properties": {
|
|
75
|
+
"in_flight": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"description": "Which block kinds at which status bucket count as in-flight (drives inFlight + focus). Stock: kinds ['tasks'], bucket 'in_progress'.",
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"required": ["kinds", "bucket"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"kinds": { "type": "array", "items": { "type": "string" } },
|
|
82
|
+
"bucket": { "type": "string" }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"focus_fallback": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"description": "Focus fallback when nothing is in-flight: an item of `kind` at status `bucket`. Stock: kind 'phase', bucket 'in_progress'.",
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"required": ["kind", "bucket"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"kind": { "type": "string" },
|
|
92
|
+
"bucket": { "type": "string" }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"next_ranked": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"description": "Ordered cross-kind push order for nextActions. Each entry selects items of `kind` at `bucket`, labels them `label`, and emits its `reason_template` (with `{rank_value}`/`{id}` tokens substituted) as each item's `reason`; optional `rank_field` + `rank_order` rank within the entry (absent → topo over the dep/gate graph). Stock: tasks (topo) then issues (priority-ranked) then framework-gaps (priority-ranked).",
|
|
98
|
+
"items": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"required": ["kind", "label", "bucket"],
|
|
102
|
+
"properties": {
|
|
103
|
+
"kind": { "type": "string" },
|
|
104
|
+
"label": { "type": "string" },
|
|
105
|
+
"bucket": { "type": "string" },
|
|
106
|
+
"rank_field": { "type": "string" },
|
|
107
|
+
"rank_order": { "type": "array", "items": { "type": "string" } },
|
|
108
|
+
"reason_template": { "type": "string", "description": "The `reason` string emitted for each item this entry surfaces. Tokens substituted literally: `{rank_value}` → the item's rank_field value (or 'unset' when absent; meaningful only for a field-ranked entry); `{id}` → the item id. Stock field-ranked (framework-gaps): 'open gap (priority {rank_value})'; stock topo (tasks): 'unblocked planned task'." }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"blocked_by": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"description": "The relation_types whose edges contribute blockers. Stock: ['task_depends_on_task', 'task_gated_by_item'].",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": ["relation_types"],
|
|
117
|
+
"properties": {
|
|
118
|
+
"relation_types": { "type": "array", "items": { "type": "string" } }
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"rollups": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"description": "Membership rollups (milestones). Each: items of `kind` whose members are parents of `membership_relation` edges; reached → `complete_status` when all members complete, else `incomplete_status`. Stock: milestone over phase_positioned_in_milestone, reached/planned.",
|
|
124
|
+
"items": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"additionalProperties": false,
|
|
127
|
+
"required": ["kind", "membership_relation", "complete_status", "incomplete_status"],
|
|
128
|
+
"properties": {
|
|
129
|
+
"kind": { "type": "string" },
|
|
130
|
+
"membership_relation": { "type": "string" },
|
|
131
|
+
"complete_status": { "type": "string" },
|
|
132
|
+
"incomplete_status": { "type": "string" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"head_size": {
|
|
137
|
+
"type": "integer",
|
|
138
|
+
"minimum": 0,
|
|
139
|
+
"description": "Truncation cap for the nextActions head. Stock: 15."
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
70
143
|
"display_strings": {
|
|
71
144
|
"type": "object",
|
|
72
145
|
"description": "Validation-code / opaque-slug → display label map.",
|
|
@@ -85,13 +158,14 @@
|
|
|
85
158
|
"category": { "type": "string", "enum": ["ordering", "data_flow", "membership"] },
|
|
86
159
|
"cycle_allowed": { "type": "boolean" },
|
|
87
160
|
"source_kinds": { "type": "array", "items": { "type": "string" }, "description": "Block_kind canonical_ids this relation's source (edge.parent) may be; literal \"*\" = any kind. Optional; absence => endpoint-kind unchecked." },
|
|
88
|
-
"target_kinds": { "type": "array", "items": { "type": "string" }, "description": "Block_kind canonical_ids this relation's target (edge.child) may be; literal \"*\" = any kind. Optional; absence => endpoint-kind unchecked." }
|
|
161
|
+
"target_kinds": { "type": "array", "items": { "type": "string" }, "description": "Block_kind canonical_ids this relation's target (edge.child) may be; literal \"*\" = any kind. Optional; absence => endpoint-kind unchecked." },
|
|
162
|
+
"role_direction": { "type": "string", "enum": ["as_parent", "as_child"], "description": "Which stored endpoint holds the relation's PRIMARY semantic role — the single orientation source of truth. Category interprets the role (ordering=antecedent, membership=container, data_flow=source); this names where it sits: as_parent=edge.parent, as_child=edge.child. Optional: set only for relations with a per-role consumer (deriver/rollup/roadmap/promote/write/read); role-less relations omit it." }
|
|
89
163
|
}
|
|
90
164
|
}
|
|
91
165
|
},
|
|
92
166
|
"invariants": {
|
|
93
167
|
"type": "array",
|
|
94
|
-
"description": "Config-declared substrate invariants enforced generically by validateProject. Each names block kinds / relation_types / status values purely as DATA — no vocabulary literal lives in source. User-overridable: a project ships only the invariants its conception requires. Discriminated by `class`: requires-edge (item must occupy an endpoint on ≥1 edge of a given relation_type)
|
|
168
|
+
"description": "Config-declared substrate invariants enforced generically by validateProject. Each names block kinds / relation_types / status values purely as DATA — no vocabulary literal lives in source. User-overridable: a project ships only the invariants its conception requires. Discriminated by `class`: requires-edge (item must occupy an endpoint on ≥1 edge of a given relation_type), status-consistency (an item's status bucket must/must-not co-occur with a related item's status bucket across an edge), or derived-status (a rollup-declared kind's stored status must equal its derived membership-rollup status, both directions).",
|
|
95
169
|
"items": {
|
|
96
170
|
"oneOf": [
|
|
97
171
|
{
|
|
@@ -125,6 +199,18 @@
|
|
|
125
199
|
"severity": { "type": "string", "enum": ["error", "warning"], "default": "error", "description": "Diagnostic severity when violated." },
|
|
126
200
|
"message": { "type": "string", "description": "Optional message template. Tokens {id} and {block} substitute. Absent → generic default." }
|
|
127
201
|
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"type": "object",
|
|
205
|
+
"required": ["id", "class", "block"],
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"properties": {
|
|
208
|
+
"id": { "type": "string", "description": "Stable invariant id, surfaced in diagnostics + the issue code field." },
|
|
209
|
+
"class": { "type": "string", "const": "derived-status", "description": "Invariant class: for a block kind whose status is mechanically derivable (declared via state_derivation.rollups), each item's STORED status must equal its DERIVED membership-rollup status. Divergence in EITHER direction (stored behind or ahead of the derivation) violates. A declaration naming a block with no matching rollups entry is inert." },
|
|
210
|
+
"block": { "type": "string", "description": "Data-file basename of the rollup block kind whose items the invariant ranges over (must match a state_derivation.rollups[].kind to have effect)." },
|
|
211
|
+
"severity": { "type": "string", "enum": ["error", "warning"], "default": "warning", "description": "Diagnostic severity on divergence. Defaults to warning: until write-time convergence and the reconcile repair path operate on a substrate, stored/derived divergence is expected steady state, not a write-blocking error." },
|
|
212
|
+
"message": { "type": "string", "description": "Optional message template. Tokens {id}, {block}, {stored} and {derived} substitute. Absent → generic default." }
|
|
213
|
+
}
|
|
128
214
|
}
|
|
129
215
|
]
|
|
130
216
|
}
|