@graphrefly/stack 0.1.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 (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -0
  3. package/dist/assets/contracts/repository/v1/repository-config.schema.json +23 -0
  4. package/dist/assets/contracts/repository/v1/review.schema.json +182 -0
  5. package/dist/assets/contracts/v1/schemas/artifacts.schema.json +584 -0
  6. package/dist/assets/contracts/v1/schemas/cli-result.schema.json +49 -0
  7. package/dist/assets/contracts/v1/schemas/golden-suite.schema.json +95 -0
  8. package/dist/assets/contracts/v1/schemas/plan-proposal.schema.json +15 -0
  9. package/dist/assets/contracts/v1/schemas/replan-proposal.schema.json +25 -0
  10. package/dist/assets/fixtures/contracts/v1/golden-suite.json +954 -0
  11. package/dist/assets/fixtures/flagship/v1/repository-template.json +48 -0
  12. package/dist/grfs.js +11102 -0
  13. package/dist/review/assets/abnfDiagram-VRR7QNED-5JVeQ-ZW.js +1 -0
  14. package/dist/review/assets/arc-CB8DclF7.js +1 -0
  15. package/dist/review/assets/architecture-TIHT7OUA-Bqe2DsxB.js +1 -0
  16. package/dist/review/assets/architectureDiagram-ZJ3FMSHR-BnEvDO7X.js +36 -0
  17. package/dist/review/assets/array-BifhSqXX.js +1 -0
  18. package/dist/review/assets/blockDiagram-677ZJIJ3-ButhTken.js +132 -0
  19. package/dist/review/assets/c4Diagram-LMCZKHZV-Dv1rgwuU.js +10 -0
  20. package/dist/review/assets/channel-HyWlF92n.js +1 -0
  21. package/dist/review/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  22. package/dist/review/assets/chunk-32BRIVSS-DPG_L6Ow.js +1 -0
  23. package/dist/review/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  24. package/dist/review/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  25. package/dist/review/assets/chunk-C7G6YPKG-WgqYOC9I.js +1 -0
  26. package/dist/review/assets/chunk-EX3LRPZG-BrpCa9zr.js +231 -0
  27. package/dist/review/assets/chunk-HOUHSVGY-BrlsNa-I.js +1 -0
  28. package/dist/review/assets/chunk-ICXQ74PX-Bmw_N4Lw.js +2 -0
  29. package/dist/review/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  30. package/dist/review/assets/chunk-KEIR6QF5-Dj-OpFgW.js +161 -0
  31. package/dist/review/assets/chunk-MOJQB5TN-BshP08Ez.js +88 -0
  32. package/dist/review/assets/chunk-OGEWGWER-fU6SYJIg.js +1 -0
  33. package/dist/review/assets/chunk-PUDLZKDR-HkwEqIVB.js +156 -0
  34. package/dist/review/assets/chunk-Q4XR5HBZ-BpeC1YXL.js +70 -0
  35. package/dist/review/assets/chunk-RYQCIY6F-0ervO6Fl.js +1 -0
  36. package/dist/review/assets/chunk-V7JOEXUC-CswDacm3.js +206 -0
  37. package/dist/review/assets/chunk-VR4S4FIN-OVY3vSUk.js +1 -0
  38. package/dist/review/assets/chunk-WYO6CB5R-C36byBU-.js +127 -0
  39. package/dist/review/assets/chunk-XXDRQBXY-D6m_P2Gv.js +1 -0
  40. package/dist/review/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  41. package/dist/review/assets/chunk-ZGVPDNZ5-_Ehp2Vnm.js +62 -0
  42. package/dist/review/assets/classDiagram-OUVF2IWQ-U8e_ZvC4.js +1 -0
  43. package/dist/review/assets/classDiagram-v2-EOCWNBFH-U8e_ZvC4.js +1 -0
  44. package/dist/review/assets/cose-bilkent-JH36ORCC-CRp3s0ZJ.js +1 -0
  45. package/dist/review/assets/cynefin-VYW2F7L2-C0b7xdyt.js +1 -0
  46. package/dist/review/assets/cynefinDiagram-TSTJHNR4-CfYu2mB5.js +62 -0
  47. package/dist/review/assets/cytoscape.esm-CQFVGiJu.js +321 -0
  48. package/dist/review/assets/dagre-VKFMJZFB-BvyihZfA.js +4 -0
  49. package/dist/review/assets/dagre-dpRSp0QF.js +1 -0
  50. package/dist/review/assets/defaultLocale-C8Fc0cco.js +1 -0
  51. package/dist/review/assets/diagram-FQU43EPY-DRoOWbTK.js +3 -0
  52. package/dist/review/assets/diagram-G47NLZAW-qFNMv5An.js +24 -0
  53. package/dist/review/assets/diagram-NH7WQ7WH-CsvacND9.js +24 -0
  54. package/dist/review/assets/diagram-OA4YK3LP-qFtWcyNi.js +30 -0
  55. package/dist/review/assets/diagram-WEI45ONY-C5nYGL8t.js +41 -0
  56. package/dist/review/assets/dist-Q9n2Bb2K.js +1 -0
  57. package/dist/review/assets/ebnfDiagram-CCIWWBDH-D_0nhpry.js +1 -0
  58. package/dist/review/assets/erDiagram-Q63AITRT-CIS7hpdK.js +85 -0
  59. package/dist/review/assets/eventmodeling-45OFAUF4-BD32wstC.js +1 -0
  60. package/dist/review/assets/flowDiagram-23GEKE2U-Df5sjnlg.js +1 -0
  61. package/dist/review/assets/ganttDiagram-NO4QXBWP-YVgrRl0A.js +292 -0
  62. package/dist/review/assets/gitGraph-TEB2WS4Q-VVXGfjmO.js +1 -0
  63. package/dist/review/assets/gitGraphDiagram-IHSO6WYX-DU6K2oph.js +106 -0
  64. package/dist/review/assets/graphlib-DS17s2tU.js +1 -0
  65. package/dist/review/assets/index-Bt3i8n39.css +1 -0
  66. package/dist/review/assets/index-CqjR4YYp.js +64 -0
  67. package/dist/review/assets/info-DKCQHKI2-Bzf5qgtg.js +1 -0
  68. package/dist/review/assets/infoDiagram-FWYZ7A6U-CT7TZgi6.js +2 -0
  69. package/dist/review/assets/init-D6jRqBbL.js +1 -0
  70. package/dist/review/assets/ishikawaDiagram-FXEZZL3T-BUpotH7r.js +70 -0
  71. package/dist/review/assets/journeyDiagram-5HDEW3XC-Dfq1Zgbg.js +139 -0
  72. package/dist/review/assets/kanban-definition-HUTT4EX6-e-emfNuh.js +89 -0
  73. package/dist/review/assets/katex-B7rAX3Vi.js +257 -0
  74. package/dist/review/assets/line-fLz2iEv2.js +1 -0
  75. package/dist/review/assets/linear-BPTPEtRN.js +1 -0
  76. package/dist/review/assets/map-BaFkSB1l.js +1 -0
  77. package/dist/review/assets/mermaid-parser.core-BJLV4lM2.js +7 -0
  78. package/dist/review/assets/mindmap-definition-LN4V7U3C-ClSEPrvR.js +96 -0
  79. package/dist/review/assets/ordinal-hYBb2elL.js +1 -0
  80. package/dist/review/assets/packet-7NZHBO7P-DV-IpgNt.js +1 -0
  81. package/dist/review/assets/path-BWPyau1x.js +1 -0
  82. package/dist/review/assets/pegDiagram-2B236MQR-Ck_v89jl.js +1 -0
  83. package/dist/review/assets/pie-RZYD4A2V-B0Ht5h6P.js +1 -0
  84. package/dist/review/assets/pieDiagram-ENE6RG2P-C63dxyZj.js +39 -0
  85. package/dist/review/assets/quadrantDiagram-ABIIQ3AL-STCrBeWw.js +7 -0
  86. package/dist/review/assets/radar-I7S5WNFK-BDk7gJ8s.js +1 -0
  87. package/dist/review/assets/railroad-3IZDKUUU-DFw02UTf.js +1 -0
  88. package/dist/review/assets/railroad-abnf-AHOZXSZD-CHMMM8DG.js +1 -0
  89. package/dist/review/assets/railroad-ebnf-EBAXGLYW-yQjh1dCt.js +1 -0
  90. package/dist/review/assets/railroad-peg-LSFZ7HO6-B9LBaRcJ.js +1 -0
  91. package/dist/review/assets/railroadDiagram-RFXS5EU6-DYI7CPMt.js +1 -0
  92. package/dist/review/assets/requirementDiagram-TGXJPOKE-BMW46SXM.js +84 -0
  93. package/dist/review/assets/rough.esm-CSKSodPl.js +1 -0
  94. package/dist/review/assets/sankeyDiagram-HTMAVEWB-wTvFx0iK.js +40 -0
  95. package/dist/review/assets/sequenceDiagram-DBY2YBRQ-DVtyVuxr.js +162 -0
  96. package/dist/review/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  97. package/dist/review/assets/src-BMa7vLb8.js +1 -0
  98. package/dist/review/assets/stateDiagram-2N3HPSRC-BM1s-zUo.js +1 -0
  99. package/dist/review/assets/stateDiagram-v2-6OUMAXLB-BEfolAkc.js +1 -0
  100. package/dist/review/assets/swimlanes-5IMT3BWC-Bnu9mzxz.js +2 -0
  101. package/dist/review/assets/swimlanesDiagram-G3AALYLV-DlNNBK53.js +8 -0
  102. package/dist/review/assets/timeline-definition-FHXFAJF6-CwlO71Lp.js +120 -0
  103. package/dist/review/assets/treeView-QDETBFTQ-e6oHg1mF.js +1 -0
  104. package/dist/review/assets/treemap-6X3UGDF4-HYeYMCQq.js +1 -0
  105. package/dist/review/assets/vennDiagram-L72KCM5P-DZxbcc_O.js +34 -0
  106. package/dist/review/assets/wardley-OPB4EBWU-BCMNVDbK.js +1 -0
  107. package/dist/review/assets/wardleyDiagram-EHGQE667-DGQto3hn.js +78 -0
  108. package/dist/review/assets/xychartDiagram-FW5EYKEG-BfD1lSXX.js +7 -0
  109. package/dist/review/index.html +32 -0
  110. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GraphReFly contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,214 @@
1
+ # GraphReFly Stack
2
+
3
+ **Semantic stacked diffs that know when their architectural assumptions expire.**
4
+
5
+ GraphReFly Stack is an OpenAI Build Week developer tool built with Codex, GPT-5.6, Git, and
6
+ GraphReFly. It adds a semantic validity layer above Git: every work-unit commit is bound to a
7
+ GraphBlueprint witness, an allowed source scope, dependency claims, required checks, and a
8
+ deterministic `GateResult`.
9
+
10
+ Git can report a clean rebase while an agent-generated change is no longer valid under the
11
+ architecture it was planned against. GraphReFly Stack makes that mismatch visible, keeps unaffected
12
+ work green, and asks GPT-5.6 to replan only the stale work. GPT-5.6 proposes; deterministic code
13
+ decides validity.
14
+
15
+ ## Install and review a GraphReFly repository
16
+
17
+ Requirements: macOS or Linux, Node.js 24, pnpm 11.7, and Git. The CLI and local web review shell use
18
+ no hosted service, database, or credentials. Once the package is published, install it in the
19
+ GraphReFly repository you want to review:
20
+
21
+ ```bash
22
+ pnpm add -D @graphrefly/stack
23
+ pnpm exec grfs init --graph-module src/application-graph.ts
24
+ git add .graphrefly-stack.json graphrefly-stack.blueprint.mjs
25
+ git commit -m "configure GraphReFly Stack"
26
+
27
+ BASE=<the commit immediately before your stack>
28
+ pnpm exec grfs review --repo . --base "$BASE" --head HEAD
29
+ ```
30
+
31
+ Open <http://127.0.0.1:4173>, then:
32
+
33
+ 1. Select each commit discovered from the real linear Git range.
34
+ 2. See the Blueprint and parent delta produced by the repository's installed GraphReFly 0.3.x
35
+ runtime.
36
+ 3. Verify that commit OID, Blueprint hash, upstream Mermaid diagram, delta events, and split code diff
37
+ move together.
38
+ 4. Expand repository evidence or commit lineage only when needed. No session, delivery, fixture, or
39
+ fake semantic-gate state appears in the generic review.
40
+
41
+ `grfs init` does not guess how an arbitrary application assembles its graph. You point it at the
42
+ module and export that already build the repository's root Graph. It generates the strict
43
+ `.graphrefly-stack.json` config and a small deterministic `graphrefly-stack.blueprint.mjs` adapter;
44
+ both are ordinary source files that should be committed. Use `--graph-export <name>` when the module
45
+ does not export `createApplicationGraph`.
46
+
47
+ The CLI executes that generated adapter at the base and every commit in permission-limited detached
48
+ worktrees. Each invocation calls the real GraphReFly `graph.blueprint()` API; Stack then parses,
49
+ verifies, renders, and diffs only with the installed runtime's public GraphReFly APIs.
50
+
51
+ ## Generic repository contract
52
+
53
+ A supported repository is a local, merge-free linear Git range with:
54
+
55
+ - a strict `.graphrefly-stack.json` selecting one repository-relative Blueprint entrypoint;
56
+ - an installed `@graphrefly/ts` version in `>=0.3.0 <0.4.0`;
57
+ - a dependency or devDependency range at every reviewed revision that accepts that installed exact
58
+ version; and
59
+ - one recognized root pnpm, npm, or Yarn lockfile at every revision.
60
+
61
+ Normal package and lockfile changes are allowed inside the stack. This first version deliberately
62
+ uses one installed GraphReFly runtime for the whole review, so it fails closed if a historical
63
+ revision declares a range incompatible with that runtime. Installing and caching a different runtime
64
+ for every revision is roadmap work.
65
+
66
+ The entrypoint must emit one hashed GraphBlueprint v2 JSON value without credentials, writes,
67
+ network access, or child processes. To inspect the same product facts without starting the web UI:
68
+
69
+ ```bash
70
+ pnpm exec grfs review --repo . --base "$BASE" --head HEAD --json
71
+ ```
72
+
73
+ The generic payload is commit-centric. When a repository has not adopted semantic change records,
74
+ the UI says `Semantic gate not configured`; it never turns missing semantic evidence into a passing
75
+ `GateResult`.
76
+
77
+ Before registry publication, the same install path is exercised from the packed tarball rather than
78
+ from workspace imports:
79
+
80
+ ```bash
81
+ pnpm test:package
82
+ ```
83
+
84
+ That test packs `@graphrefly/stack`, installs it with GraphReFly 0.3.x in a temporary independent Git
85
+ repository, runs `pnpm exec grfs init`, creates a real two-commit stack, verifies its Blueprint delta
86
+ and structured code diff, and fetches the embedded review UI plus its review-data endpoint.
87
+
88
+ ## Historical semantic flagship and CLI cases
89
+
90
+ The earlier refresh-token flagship remains as compatibility evidence for selective semantic
91
+ invalidation and GPT-5.6 replanning:
92
+
93
+ ```bash
94
+ pnpm cli fixture create --force --json
95
+ pnpm cli gate --case current-valid --json
96
+ pnpm cli gate --case clean-rebase-semantic-stale --json # expected exit 2
97
+ pnpm cli gate --case fresh-selective-replan --json
98
+ pnpm cli export --output .private/exports/judge-run --json
99
+ pnpm cli review --bundle evidence/runs/refresh-token-rotation-v1-live/evidence-bundle.json
100
+ ```
101
+
102
+ The CLI emits one versioned JSON envelope on stdout. Exit `0` means success, exit `2` is an expected
103
+ deterministic blocked gate, and exit `1` is a usage, schema, or runtime error. Run the complete local
104
+ quality gate with `pnpm check`.
105
+
106
+ ## What the historical flagship proves
107
+
108
+ The fixed refresh-token-rotation stack contains U1 contracts, U2 GraphReFly runtime, and U3 HTTP
109
+ adapter work. A concurrent architecture commit introduces `sessionMutationBroker` and advances the
110
+ session-write policy. Git rebases the stack without a text conflict and ordinary checks stay green,
111
+ but the deterministic semantic gate detects that U2's architecture and policy witnesses expired.
112
+ Only U2 and its dependent U3 are invalidated. A validated GPT-5.6 selective replan preserves U1,
113
+ rebinds U2 and U3 to current witnesses, and restores the final gate without model self-grading.
114
+
115
+ The evidence bundle covers six locked cases: current-valid, clean-rebase-semantic-stale,
116
+ unrelated-change-still-valid, stale-parent, forged-or-wrong-scope, and fresh-selective-replan.
117
+
118
+ ## Live GPT-5.6 path
119
+
120
+ Replay is the default. Live mode is explicit and performs exactly one server-side Codex SDK request
121
+ per command with a strict output schema, read-only sandbox, approval disabled, network disabled, and
122
+ a 120-second timeout:
123
+
124
+ ```bash
125
+ pnpm cli fixture create --force --json
126
+ GRAPHREFLY_STACK_CODEX_PATH=/path/to/compatible/codex \
127
+ pnpm cli plan --mode live --json
128
+ GRAPHREFLY_STACK_CODEX_PATH=/path/to/compatible/codex \
129
+ pnpm cli replan --mode live --json
130
+ ```
131
+
132
+ Authentication may come from an existing `CODEX_HOME`, `OPENAI_API_KEY`, or `CODEX_API_KEY`; never
133
+ commit or share credentials. `GRAPHREFLY_STACK_MODEL` defaults to `gpt-5.6-sol`, and
134
+ `GRAPHREFLY_STACK_REASONING_EFFORT` defaults to `high`. The validated Build Week run used Codex SDK
135
+ 0.143.0 with a compatible `codex-cli 0.144.5` runtime override. Exact model, effort, runtime, thread,
136
+ token usage, prompt version, and response/output digests are preserved in the redacted bundle.
137
+
138
+ The validated plan used 14,030 input, 370 output, and 52 reasoning tokens; the corrected selective
139
+ replan used 14,351 input, 360 output, and 105 reasoning tokens. There are no autonomous retries or
140
+ unbounded model loops. A provider failure is an error unless the caller explicitly opts into the
141
+ provenance-labelled replay fallback.
142
+
143
+ ## Architecture and trust boundary
144
+
145
+ - `packages/contracts` owns strict schemas, including the generic repository and review protocols,
146
+ plus RFC 8785 canonical bytes.
147
+ - `packages/core` owns deterministic gate behavior and adapter ports.
148
+ - `packages/cli` is the only composition root for Git, GraphReFly, Codex, evidence export, and the
149
+ loopback review server.
150
+ - `apps/review` is a read-only React projection of canonical artifacts.
151
+
152
+ For generic structural review, the repository's target GraphReFly runtime exclusively owns Blueprint
153
+ parsing, hash verification, readable diagram source, and structural delta. For the historical
154
+ semantic workflow, GPT-5.6 proposes plans, claim wording, and selective replans while deterministic
155
+ code owns scope, freshness, dependency, check, and verdict semantics.
156
+
157
+ ## How Codex built the project
158
+
159
+ The majority of GraphReFly Stack was built in one long-lived Codex task using a canonical JSONL
160
+ sequencer. Codex helped consolidate the scenario and contract decisions, scaffold the TypeScript
161
+ workspaces, implement real-Git fixtures and the deterministic gate, integrate the server-side Codex
162
+ SDK seam, adversarially test provenance and scope boundaries, and iterate on the synchronized review
163
+ UI. Human approvals locked the material product, contract, architecture, and UI decisions before
164
+ core behavior was implemented.
165
+
166
+ GPT-5.6 is also part of the finished product: its real structured ChangePlan and selective-replan
167
+ outputs are schema-validated, checked against locked anchors, bound to exact provenance, and then
168
+ passed to deterministic code. The model cannot widen scopes, change dependencies or checks, approve
169
+ work, or generate its own verdict.
170
+
171
+ ## Build Week work and prior work
172
+
173
+ GraphReFly itself is a pre-existing external dependency. The generic product targets the published
174
+ `@graphrefly/ts` 0.3.x Blueprint v2 API surface; the historical flagship preserves its earlier v1
175
+ evidence. The GraphReFly Stack product, contracts, real-Git flagship fixture, deterministic semantic
176
+ gate, Codex integration, evidence exporter, and review UI were created or materially implemented
177
+ during the Build Week submission period beginning July 13, 2026. The repository's dated Git history
178
+ and canonical milestones in `docs/evidence/milestones.jsonl` distinguish that work.
179
+
180
+ ## Evidence, security, and limitations
181
+
182
+ - `evidence/runs/refresh-token-rotation-v1-live/evidence-bundle.json` embeds its manifest and every
183
+ redacted logical artifact, each bound by SHA-256 over canonical JSON. Expanded copies are generated
184
+ output and are not tracked.
185
+ - The portable bundle is not self-listed in its manifest because that would create a circular hash.
186
+ - Raw provider responses, generated repositories, and sensitive submission drafts stay under
187
+ ignored `.private/` paths.
188
+ - The review server only binds to `127.0.0.1`, sends a restrictive CSP, accepts only GET/HEAD, and
189
+ exposes no write endpoint.
190
+ - Generic Blueprint entrypoints run with an empty environment, a five-second timeout, a one-MiB
191
+ stdout bound, read-only filesystem allowlists, and no network or child-process permission.
192
+ - Generic payloads omit Blueprint provenance and reject absolute paths in topology metadata before
193
+ serving browser data.
194
+ - The first release supports a maximum of 64 commits in one merge-free linear range. DAG stacks,
195
+ per-revision dependency installs, monorepo package selection, hosted review, planning, mutual
196
+ exclusion, edit scopes, conflict avoidance, and revert remain roadmap work.
197
+
198
+ Canonical scope, decisions, contracts, sequence, and evidence requirements are indexed by
199
+ [`docs/sources.jsonl`](docs/sources.jsonl). Read [`docs/README.md`](docs/README.md) for the authority
200
+ map.
201
+
202
+ ## Repository map
203
+
204
+ - `apps/review/` — synchronized local review UI
205
+ - `packages/` — contracts, deterministic core, and CLI composition root
206
+ - `contracts/` and `fixtures/` — strict schemas, compatibility artifacts, and conformance scenarios
207
+ - `evidence/` — curated redacted evidence bundles
208
+ - `docs/` — canonical JSONL project and submission records
209
+ - `.agents/skills/` — project workflows that operate on canonical records
210
+ - `.private/` — ignored raw responses, live runs, generated repositories, and drafts
211
+
212
+ ## License
213
+
214
+ [MIT](LICENSE)
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "urn:graphrefly-stack:schema:repository-config:v1",
4
+ "title": "GraphReFly Stack repository config v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "blueprint"],
8
+ "properties": {
9
+ "schema": { "const": "graphrefly.stack.repository.v1" },
10
+ "blueprint": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["entrypoint"],
14
+ "properties": {
15
+ "entrypoint": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[A-Za-z0-9._/-]+$"
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,182 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "urn:graphrefly-stack:schema:repository-review:v1",
4
+ "title": "GraphReFly Stack generic repository review v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "source", "repository", "base", "commits", "semanticStatus"],
8
+ "properties": {
9
+ "schema": { "const": "graphrefly.stack.review.v1" },
10
+ "source": { "const": "generic-repository" },
11
+ "repository": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["label", "graphreflyVersion", "entrypoint", "baseOid", "headOid"],
15
+ "properties": {
16
+ "label": { "type": "string", "minLength": 1 },
17
+ "graphreflyVersion": { "type": "string", "pattern": "^0\\.3\\.[0-9]+$" },
18
+ "entrypoint": {
19
+ "$ref": "urn:graphrefly-stack:schema:repository-config:v1#/properties/blueprint/properties/entrypoint"
20
+ },
21
+ "baseOid": { "$ref": "#/definitions/GitOid" },
22
+ "headOid": { "$ref": "#/definitions/GitOid" }
23
+ }
24
+ },
25
+ "base": { "$ref": "#/definitions/RevisionEvidence" },
26
+ "commits": {
27
+ "type": "array",
28
+ "minItems": 1,
29
+ "items": { "$ref": "#/definitions/ReviewCommit" }
30
+ },
31
+ "semanticStatus": { "const": "not-configured" }
32
+ },
33
+ "definitions": {
34
+ "GitOid": { "type": "string", "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" },
35
+ "Hash": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": ["kind", "algorithm", "input", "value"],
39
+ "properties": {
40
+ "kind": { "const": "topology" },
41
+ "algorithm": { "const": "sha256" },
42
+ "input": { "const": "strictCanonicalTopologyBytes" },
43
+ "value": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
44
+ }
45
+ },
46
+ "Blueprint": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": ["version", "topology", "diagnostics", "hash"],
50
+ "properties": {
51
+ "version": { "const": "graphrefly.blueprint.v2" },
52
+ "topology": { "type": "object" },
53
+ "diagnostics": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": ["ok", "issues"],
57
+ "properties": {
58
+ "ok": { "const": true },
59
+ "issues": { "type": "array" }
60
+ }
61
+ },
62
+ "provenance": { "type": "object" },
63
+ "hash": { "$ref": "#/definitions/Hash" }
64
+ }
65
+ },
66
+ "Diagram": {
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": ["format", "renderer", "source"],
70
+ "properties": {
71
+ "format": { "const": "mermaid" },
72
+ "renderer": { "const": "@graphrefly/ts/render.blueprintToMermaid" },
73
+ "source": { "type": "string", "pattern": "^flowchart " }
74
+ }
75
+ },
76
+ "Delta": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["version", "fromBlueprintVersion", "toBlueprintVersion", "events"],
80
+ "properties": {
81
+ "version": { "const": "graphrefly.blueprint-delta.v1" },
82
+ "fromBlueprintVersion": { "const": "graphrefly.blueprint.v2" },
83
+ "toBlueprintVersion": { "const": "graphrefly.blueprint.v2" },
84
+ "fromHash": { "$ref": "#/definitions/Hash" },
85
+ "toHash": { "$ref": "#/definitions/Hash" },
86
+ "events": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "required": ["type", "topologyPath"],
91
+ "properties": {
92
+ "type": {
93
+ "enum": [
94
+ "subgraph-added",
95
+ "node-added",
96
+ "node-changed",
97
+ "edge-added",
98
+ "edge-removed",
99
+ "node-removed",
100
+ "subgraph-removed"
101
+ ]
102
+ },
103
+ "topologyPath": { "type": "array", "items": { "type": "string", "minLength": 1 } }
104
+ },
105
+ "additionalProperties": true
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "DiffLine": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": ["kind", "content"],
114
+ "properties": {
115
+ "kind": { "enum": ["context", "delete", "add"] },
116
+ "content": { "type": "string" },
117
+ "oldNo": { "type": "integer", "minimum": 1 },
118
+ "newNo": { "type": "integer", "minimum": 1 }
119
+ }
120
+ },
121
+ "StructuredDiff": {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": ["paths", "files"],
125
+ "properties": {
126
+ "paths": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
127
+ "files": {
128
+ "type": "array",
129
+ "items": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": ["oldPath", "newPath", "additions", "deletions", "binary", "hunks"],
133
+ "properties": {
134
+ "oldPath": { "type": "string" },
135
+ "newPath": { "type": "string" },
136
+ "additions": { "type": "integer", "minimum": 0 },
137
+ "deletions": { "type": "integer", "minimum": 0 },
138
+ "binary": { "type": "boolean" },
139
+ "hunks": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": ["header", "lines"],
145
+ "properties": {
146
+ "header": { "type": "string" },
147
+ "lines": { "type": "array", "items": { "$ref": "#/definitions/DiffLine" } }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ },
156
+ "RevisionEvidence": {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "required": ["oid", "subject", "blueprint", "diagram"],
160
+ "properties": {
161
+ "oid": { "$ref": "#/definitions/GitOid" },
162
+ "subject": { "type": "string" },
163
+ "blueprint": { "$ref": "#/definitions/Blueprint" },
164
+ "diagram": { "$ref": "#/definitions/Diagram" }
165
+ }
166
+ },
167
+ "ReviewCommit": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": ["oid", "parentOid", "subject", "blueprint", "diagram", "delta", "diff"],
171
+ "properties": {
172
+ "oid": { "$ref": "#/definitions/GitOid" },
173
+ "parentOid": { "$ref": "#/definitions/GitOid" },
174
+ "subject": { "type": "string" },
175
+ "blueprint": { "$ref": "#/definitions/Blueprint" },
176
+ "diagram": { "$ref": "#/definitions/Diagram" },
177
+ "delta": { "$ref": "#/definitions/Delta" },
178
+ "diff": { "$ref": "#/definitions/StructuredDiff" }
179
+ }
180
+ }
181
+ }
182
+ }