|
| 1 | +/** Machine-readable contract for the graph we are building. */ |
| 2 | +export type NodeStatus = "implemented" | "partial" | "planned"; |
| 3 | + |
| 4 | +export interface GraphNodeDefinition { |
| 5 | + id: string; |
| 6 | + responsibility: string; |
| 7 | + kind: "deterministic" | "agent" | "parallel" | "human-gate" | "side-effect"; |
| 8 | + status: NodeStatus; |
| 9 | +} |
| 10 | + |
| 11 | +export interface ReviewerDefinition { |
| 12 | + id: |
| 13 | + | "security" |
| 14 | + | "architecture" |
| 15 | + | "technology" |
| 16 | + | "performance" |
| 17 | + | "tests" |
| 18 | + | "accessibility" |
| 19 | + | "code-quality" |
| 20 | + | "bugs" |
| 21 | + | "visual-design"; |
| 22 | + question: string; |
| 23 | + requiresVisualEvidence: boolean; |
| 24 | +} |
| 25 | + |
| 26 | +export const reviewers: readonly ReviewerDefinition[] = [ |
| 27 | + { id: "security", question: "Does the change introduce exploitable behavior, unsafe trust boundaries, or leaked secrets?", requiresVisualEvidence: false }, |
| 28 | + { id: "architecture", question: "Does the change preserve the application's boundaries, ownership, and long-term design?", requiresVisualEvidence: false }, |
| 29 | + { id: "technology", question: "Does it follow the current framework, language, and repository-specific practices?", requiresVisualEvidence: false }, |
| 30 | + { id: "performance", question: "Does it create unacceptable latency, memory, network, bundle-size, or scaling costs?", requiresVisualEvidence: false }, |
| 31 | + { id: "tests", question: "Are the acceptance criteria independently covered, including important failure paths?", requiresVisualEvidence: false }, |
| 32 | + { id: "accessibility", question: "Can people using keyboards and assistive technology perceive and operate the result?", requiresVisualEvidence: true }, |
| 33 | + { id: "code-quality", question: "Is the change understandable, maintainable, cohesive, and appropriately simple?", requiresVisualEvidence: false }, |
| 34 | + { id: "bugs", question: "What incorrect behavior, edge cases, races, or regressions remain?", requiresVisualEvidence: false }, |
| 35 | + { id: "visual-design", question: "Is the rendered result visually appealing and consistent with the rest of the application?", requiresVisualEvidence: true }, |
| 36 | +] as const; |
| 37 | + |
| 38 | +export const productionGraph: readonly GraphNodeDefinition[] = [ |
| 39 | + { id: "github-ingest", responsibility: "Persist, deduplicate, correlate, and acknowledge GitHub events.", kind: "deterministic", status: "implemented" }, |
| 40 | + { id: "readiness-and-decomposition", responsibility: "Verify sufficient context and decide whether the issue should be split into child issues.", kind: "agent", status: "planned" }, |
| 41 | + { id: "human-clarification", responsibility: "Suspend and resume when missing information or a product decision requires a human.", kind: "human-gate", status: "partial" }, |
| 42 | + { id: "codex-goal-implementation", responsibility: "Implement one accepted issue in an isolated worktree against explicit acceptance criteria.", kind: "agent", status: "planned" }, |
| 43 | + { id: "deterministic-checks", responsibility: "Run repository-owned tests, builds, linting, type checks, and policy checks.", kind: "deterministic", status: "planned" }, |
| 44 | + { id: "specialist-reviewers", responsibility: "Run the independent reviewer set in parallel against one fixed implementation snapshot.", kind: "parallel", status: "planned" }, |
| 45 | + { id: "review-manager", responsibility: "Consolidate evidence, resolve compatible findings, route repairs, and expose true conflicts.", kind: "agent", status: "planned" }, |
| 46 | + { id: "human-conflict-decision", responsibility: "Choose between irreconcilable recommendations using their evidence and trade-offs.", kind: "human-gate", status: "planned" }, |
| 47 | + { id: "pull-request", responsibility: "Publish an approved, verified change and its evidence exactly once.", kind: "side-effect", status: "planned" }, |
| 48 | + { id: "recorder", responsibility: "Append reconstructable run evidence without modifying the active graph.", kind: "deterministic", status: "planned" }, |
| 49 | +] as const; |
| 50 | + |
| 51 | +export const selfImprovementGraph: readonly GraphNodeDefinition[] = [ |
| 52 | + { id: "select-new-experiences", responsibility: "Read production evidence after lastAnalysedRunId while retaining older replay cases.", kind: "deterministic", status: "planned" }, |
| 53 | + { id: "distil-lessons", responsibility: "Identify recurring failures and propose bounded prompt, skill, rubric, or graph changes.", kind: "agent", status: "planned" }, |
| 54 | + { id: "baseline-versus-candidate-replay", responsibility: "Run identical representative cases against the frozen baseline and each candidate.", kind: "parallel", status: "planned" }, |
| 55 | + { id: "improvement-gates", responsibility: "Reject regressions, safety violations, semantic drift, and unsupported gains.", kind: "deterministic", status: "planned" }, |
| 56 | + { id: "human-promotion", responsibility: "Approve a versioned candidate for future runs; never mutate active runs.", kind: "human-gate", status: "planned" }, |
| 57 | +] as const; |
0 commit comments