codecartographer-pi 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.
- package/.codecarto/BACKLOG.md +192 -0
- package/.codecarto/CHANGELOG-2026-05-02-feedback-pass.md +118 -0
- package/.codecarto/CONTRIBUTING.md +56 -0
- package/.codecarto/GUIDE.md +298 -0
- package/.codecarto/LICENSE +21 -0
- package/.codecarto/NEW_THREAD_BLURB.md +47 -0
- package/.codecarto/README.md +39 -0
- package/.codecarto/THREAD_LOG.md +39 -0
- package/.codecarto/closeouts/2026-05-02-framework-feedback-pass.md +111 -0
- package/.codecarto/findings/architecture/README.md +3 -0
- package/.codecarto/findings/architecture/SKILL.md +102 -0
- package/.codecarto/findings/build-and-deploy/.gitkeep +0 -0
- package/.codecarto/findings/config-model/.gitkeep +0 -0
- package/.codecarto/findings/contracts/README.md +3 -0
- package/.codecarto/findings/contracts/SKILL.md +89 -0
- package/.codecarto/findings/defect-scan/README.md +18 -0
- package/.codecarto/findings/defect-scan/SKILL.md +87 -0
- package/.codecarto/findings/defect-scan/passes/01-logic-and-correctness.md +50 -0
- package/.codecarto/findings/defect-scan/passes/02-error-handling.md +55 -0
- package/.codecarto/findings/defect-scan/passes/03-concurrency-and-resources.md +54 -0
- package/.codecarto/findings/defect-scan/passes/04-security-and-trust.md +62 -0
- package/.codecarto/findings/defect-scan/passes/05-api-contract-violations.md +57 -0
- package/.codecarto/findings/defect-scan/passes/06-config-and-environment.md +58 -0
- package/.codecarto/findings/defect-scan-mechanical/README.md +17 -0
- package/.codecarto/findings/defect-scan-mechanical/SKILL.md +60 -0
- package/.codecarto/findings/defect-scan-semantic/README.md +17 -0
- package/.codecarto/findings/defect-scan-semantic/SKILL.md +54 -0
- package/.codecarto/findings/porting/README.md +3 -0
- package/.codecarto/findings/porting/SKILL.md +52 -0
- package/.codecarto/findings/protocols/README.md +3 -0
- package/.codecarto/findings/protocols/SKILL.md +87 -0
- package/.codecarto/findings/public-surfaces/README.md +3 -0
- package/.codecarto/findings/reimplementation-spec/README.md +3 -0
- package/.codecarto/findings/reimplementation-spec/SKILL.md +66 -0
- package/.codecarto/findings/runtime-lifecycle/README.md +3 -0
- package/.codecarto/findings/state-and-storage/README.md +3 -0
- package/.codecarto/scratch/.gitkeep +0 -0
- package/.codecarto/skills/spec-delta-application/SKILL.md +102 -0
- package/.codecarto/templates/architecture-map.md +143 -0
- package/.codecarto/templates/behavioral-contracts.md +134 -0
- package/.codecarto/templates/closeout-template.md +85 -0
- package/.codecarto/templates/conventions-template.md +65 -0
- package/.codecarto/templates/decisions-template.md +82 -0
- package/.codecarto/templates/defect-fix-tracker.md +77 -0
- package/.codecarto/templates/defect-report.md +116 -0
- package/.codecarto/templates/deltas-applied.md +71 -0
- package/.codecarto/templates/mechanical-defects.md +104 -0
- package/.codecarto/templates/protocols-and-state.md +126 -0
- package/.codecarto/templates/reimplementation-spec-opinionated.md +183 -0
- package/.codecarto/templates/reimplementation-spec.md +148 -0
- package/.codecarto/templates/reverse-engineering-bundle.md +141 -0
- package/.codecarto/templates/semantic-defects.md +109 -0
- package/.codecarto/templates/thread-log-entry-template.md +27 -0
- package/.codecarto/workflow/VALIDATE.md +81 -0
- package/.codecarto/workflow/pipeline-architecture-only.yaml +38 -0
- package/.codecarto/workflow/pipeline-defect-scan.yaml +61 -0
- package/.codecarto/workflow/pipeline-full-with-audit.yaml +188 -0
- package/.codecarto/workflow/pipeline-full-with-deep-audit.yaml +227 -0
- package/.codecarto/workflow/pipeline-lite.yaml +100 -0
- package/.codecarto/workflow/pipeline.yaml +163 -0
- package/.codecarto/workflow/status.yaml +64 -0
- package/LICENSE +21 -0
- package/README.md +356 -0
- package/core/index.ts +11 -0
- package/core/pipeline.ts +175 -0
- package/core/prompts.ts +183 -0
- package/core/status.ts +155 -0
- package/core/types.ts +96 -0
- package/core/utils.ts +52 -0
- package/core/workspace.ts +81 -0
- package/core/yaml.ts +256 -0
- package/extensions/codecarto/index.ts +446 -0
- package/mcp-server/bin.mjs +7 -0
- package/mcp-server/server.ts +497 -0
- package/package.json +52 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Mechanical Defects Report — [project_name]
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Output template for the `defect-scan-mechanical` phase.
|
|
5
|
+
Covers passes 1, 2, and 6 from the defect-scan methodology — the bugs visible
|
|
6
|
+
from local code reading without contracts or protocols context.
|
|
7
|
+
See findings/defect-scan-mechanical/SKILL.md for instructions.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
## Scan Context
|
|
11
|
+
|
|
12
|
+
- **Source:** `../` (repository root)
|
|
13
|
+
- **Architecture reference:** `findings/architecture/architecture-map.md`
|
|
14
|
+
- **Pipeline:** [pipeline variant name]
|
|
15
|
+
- **Date:** [date]
|
|
16
|
+
- **Scope:** Mechanical passes only (1 logic, 2 error handling, 6 configuration). Semantic passes (3 concurrency, 4 security, 5 contract violations) deferred to `defect-scan-semantic` after protocols.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Pass 1: Logic and Correctness
|
|
21
|
+
|
|
22
|
+
<!-- For each finding: location, defect, evidence, severity, evidence level, action. -->
|
|
23
|
+
<!-- Sort by severity: critical → high → medium → low. -->
|
|
24
|
+
<!-- If no findings, write "No defects found in this category." -->
|
|
25
|
+
|
|
26
|
+
| # | Location | Defect | Severity | Evidence Level | Action |
|
|
27
|
+
|---|----------|--------|----------|----------------|--------|
|
|
28
|
+
| 1 | | | | | |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Pass 2: Error Handling and Resilience
|
|
33
|
+
|
|
34
|
+
| # | Location | Defect | Severity | Evidence Level | Action |
|
|
35
|
+
|---|----------|--------|----------|----------------|--------|
|
|
36
|
+
| 1 | | | | | |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Pass 6: Configuration and Environment Hazards
|
|
41
|
+
|
|
42
|
+
| # | Location | Defect | Severity | Evidence Level | Action |
|
|
43
|
+
|---|----------|--------|----------|----------------|--------|
|
|
44
|
+
| 1 | | | | | |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Summary
|
|
49
|
+
|
|
50
|
+
### Findings by Severity
|
|
51
|
+
|
|
52
|
+
| Severity | Count |
|
|
53
|
+
|----------|-------|
|
|
54
|
+
| Critical | |
|
|
55
|
+
| High | |
|
|
56
|
+
| Medium | |
|
|
57
|
+
| Low | |
|
|
58
|
+
| **Total** | |
|
|
59
|
+
|
|
60
|
+
### Findings by Pass
|
|
61
|
+
|
|
62
|
+
| Pass | Critical | High | Medium | Low | Total |
|
|
63
|
+
|------|----------|------|--------|-----|-------|
|
|
64
|
+
| 1. Logic and correctness | | | | | |
|
|
65
|
+
| 2. Error handling | | | | | |
|
|
66
|
+
| 6. Config and environment | | | | | |
|
|
67
|
+
|
|
68
|
+
### Top Findings
|
|
69
|
+
|
|
70
|
+
<!-- List the most impactful findings across the mechanical passes, ranked by severity and confidence.
|
|
71
|
+
Include: pass number, location, one-line defect description, severity, recommended action. -->
|
|
72
|
+
|
|
73
|
+
1.
|
|
74
|
+
2.
|
|
75
|
+
3.
|
|
76
|
+
4.
|
|
77
|
+
5.
|
|
78
|
+
|
|
79
|
+
### Routed To Semantic Phase
|
|
80
|
+
|
|
81
|
+
<!-- Items spotted during this phase that are actually semantic in nature
|
|
82
|
+
(concurrency, security, contract drift). Mirror these into status.yaml as
|
|
83
|
+
carry_forward entries with target_phase: defect-scan-semantic. -->
|
|
84
|
+
|
|
85
|
+
| ID | Description | Why Routed |
|
|
86
|
+
|----|-------------|-----------|
|
|
87
|
+
| | | |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Validation
|
|
92
|
+
|
|
93
|
+
<!-- Fill in this table per workflow/VALIDATE.md. The rows below match the mechanical-pass scope. -->
|
|
94
|
+
|
|
95
|
+
| # | Criterion | Result | Evidence |
|
|
96
|
+
|---|-----------|--------|----------|
|
|
97
|
+
| 1 | At least two of the three mechanical passes (1, 2, 6) produced findings or documented "no defects found." | PASS / PARTIAL / FAIL | |
|
|
98
|
+
| 2 | Each finding has location, severity, evidence level, and recommended action. | PASS / PARTIAL / FAIL | |
|
|
99
|
+
| 3 | Findings are organized by pass and sorted by severity. | PASS / PARTIAL / FAIL | |
|
|
100
|
+
| 4 | Summary tables are complete and counts match the detailed findings. | PASS / PARTIAL / FAIL | |
|
|
101
|
+
| 5 | Findings are marked with evidence levels. | PASS / PARTIAL / FAIL | |
|
|
102
|
+
|
|
103
|
+
**Validated by:** [session identifier or date]
|
|
104
|
+
**Overall:** PASS / PASS WITH GAPS / FAIL
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Protocols and State
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Output template for the protocols phase.
|
|
5
|
+
Fill in each section. Remove placeholder text. Keep the section headers.
|
|
6
|
+
Treat every boundary as a protocol boundary.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
## Boundaries Identified
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
List the protocol boundaries found:
|
|
13
|
+
- process to process
|
|
14
|
+
- UI to core
|
|
15
|
+
- core to provider
|
|
16
|
+
- tool layer to runtime
|
|
17
|
+
- runtime to persistence
|
|
18
|
+
- local files to exported artifacts
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
## Event Catalog
|
|
22
|
+
|
|
23
|
+
<!--
|
|
24
|
+
For each protocol or event stream:
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
### [Protocol / Event Stream Name]
|
|
28
|
+
|
|
29
|
+
| Field | Value |
|
|
30
|
+
|---|---|
|
|
31
|
+
| **Producer** | |
|
|
32
|
+
| **Consumer** | |
|
|
33
|
+
| **Transport or carrier** | |
|
|
34
|
+
| **Ordering guarantees** | |
|
|
35
|
+
| **Required fields** | |
|
|
36
|
+
| **Optional fields** | |
|
|
37
|
+
| **Identifiers and timestamps** | |
|
|
38
|
+
| **Error cases** | |
|
|
39
|
+
| **Restart or resume behavior** | |
|
|
40
|
+
|
|
41
|
+
<!-- Repeat for each protocol. -->
|
|
42
|
+
|
|
43
|
+
## State Machine
|
|
44
|
+
|
|
45
|
+
<!--
|
|
46
|
+
For each significant state machine:
|
|
47
|
+
- Name the states
|
|
48
|
+
- Name the transitions
|
|
49
|
+
- Record guards and side effects
|
|
50
|
+
- Separate synchronous barriers from observational events
|
|
51
|
+
|
|
52
|
+
ASCII diagrams or tables are both acceptable.
|
|
53
|
+
-->
|
|
54
|
+
|
|
55
|
+
### [State Machine Name]
|
|
56
|
+
|
|
57
|
+
| Current State | Event / Trigger | Guard | Next State | Side Effects |
|
|
58
|
+
|---|---|---|---|---|
|
|
59
|
+
| | | | | |
|
|
60
|
+
|
|
61
|
+
## Persistent Schema Notes
|
|
62
|
+
|
|
63
|
+
<!--
|
|
64
|
+
For each persistence mechanism:
|
|
65
|
+
- Append-only vs mutable
|
|
66
|
+
- Branching vs linear history
|
|
67
|
+
- Compaction or summarization rules
|
|
68
|
+
- Replay or resume behavior
|
|
69
|
+
- Locking, deduplication, or conflict handling
|
|
70
|
+
-->
|
|
71
|
+
|
|
72
|
+
## Compatibility Hazards
|
|
73
|
+
|
|
74
|
+
<!--
|
|
75
|
+
Portability hazards that frequently break ports:
|
|
76
|
+
- ANSI terminal semantics
|
|
77
|
+
- IME or cursor positioning rules
|
|
78
|
+
- Filesystem locking assumptions
|
|
79
|
+
- Async ordering guarantees
|
|
80
|
+
- OAuth token refresh behavior
|
|
81
|
+
- Shell quoting and OS differences
|
|
82
|
+
- Encoding, width, or Unicode handling
|
|
83
|
+
-->
|
|
84
|
+
|
|
85
|
+
| Hazard | Where It Appears | Severity | Notes |
|
|
86
|
+
|---|---|---|---|
|
|
87
|
+
| | | | |
|
|
88
|
+
|
|
89
|
+
## Open Questions
|
|
90
|
+
|
|
91
|
+
<!-- Items that are still genuinely unknown — need a runtime test, maintainer decision, or spec ruling.
|
|
92
|
+
NOT items deferred to a later phase in this pipeline (those go in Carry-Forward).
|
|
93
|
+
Each entry: { id, kind, description, deferred_reason }. See workflow/status.yaml schema. -->
|
|
94
|
+
|
|
95
|
+
| ID | Kind | Description | Deferred Reason |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| | | | |
|
|
98
|
+
|
|
99
|
+
## Carry-Forward
|
|
100
|
+
|
|
101
|
+
<!-- Items deferred to a specific later phase whose rubric is the right place to close them.
|
|
102
|
+
Common target from protocols: porting (synthesis-level resolution).
|
|
103
|
+
Each entry: { id, kind: defer-to-phase, target_phase, description, deferred_reason }.
|
|
104
|
+
Mirror these into workflow/status.yaml under this phase's carry_forward list. -->
|
|
105
|
+
|
|
106
|
+
| ID | Target Phase | Description | Deferred Reason |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| | | | |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Validation
|
|
113
|
+
|
|
114
|
+
<!-- Fill in this table per workflow/VALIDATE.md. The rows below match the full pipeline.
|
|
115
|
+
Adjust rows to match your active pipeline's completion_criteria if using a variant. -->
|
|
116
|
+
|
|
117
|
+
| # | Criterion | Result | Evidence |
|
|
118
|
+
|---|-----------|--------|----------|
|
|
119
|
+
| 1 | An event catalog is documented. | PASS / PARTIAL / FAIL | |
|
|
120
|
+
| 2 | A state machine is documented. | PASS / PARTIAL / FAIL | |
|
|
121
|
+
| 3 | Persistent schema notes are documented. | PASS / PARTIAL / FAIL | |
|
|
122
|
+
| 4 | Compatibility hazards are documented. | PASS / PARTIAL / FAIL | |
|
|
123
|
+
| 5 | Findings are marked with evidence levels. | PASS / PARTIAL / FAIL | |
|
|
124
|
+
|
|
125
|
+
**Validated by:** [session identifier or date]
|
|
126
|
+
**Overall:** PASS / PASS WITH GAPS / FAIL
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Reimplementation Spec — <Project Name>
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Output template for the reimplementation-spec phase, OPINIONATED variant.
|
|
5
|
+
|
|
6
|
+
Use this template when the orchestrator's strategic-alignment hook (see GUIDE.md) has
|
|
7
|
+
pre-locked: target stack, project identity, scope cuts, named modules, and named primitives.
|
|
8
|
+
|
|
9
|
+
This is a SIBLING of templates/reimplementation-spec.md (the language-agnostic default), not a
|
|
10
|
+
replacement. Pick at session start based on the strategic-alignment conversation:
|
|
11
|
+
|
|
12
|
+
- Default (any port to any stack) → templates/reimplementation-spec.md
|
|
13
|
+
- Opinionated (locked stack + identity) → templates/reimplementation-spec-opinionated.md (this file)
|
|
14
|
+
|
|
15
|
+
The differences from the default template:
|
|
16
|
+
- Project identity (name, language, runtime, lint/format toolchain) is fixed at the top.
|
|
17
|
+
- "External Dependencies" is replaced with "Locked Stack" — the answer is given, not chosen.
|
|
18
|
+
- "Layer Split" is replaced with "Named Module Inventory" — modules have committed names.
|
|
19
|
+
- "Acceptance Scenarios" stays — scenarios are independent of stack choice.
|
|
20
|
+
- Adds "Spec Conventions" (citation forms, evidence-level codes, [revised per ...] marker).
|
|
21
|
+
- Adds "Spike List" up-front because opinionated specs typically pre-identify spikes.
|
|
22
|
+
|
|
23
|
+
Fill in each section. Remove placeholder text. Keep the section headers.
|
|
24
|
+
-->
|
|
25
|
+
|
|
26
|
+
## Project Identity
|
|
27
|
+
|
|
28
|
+
| Field | Value |
|
|
29
|
+
|---|---|
|
|
30
|
+
| **Project name** | <e.g., Thaumaturge> |
|
|
31
|
+
| **CLI command** | <e.g., thaum> |
|
|
32
|
+
| **Primary language / runtime** | <e.g., TypeScript on Bun> |
|
|
33
|
+
| **License** | <e.g., Apache-2.0> |
|
|
34
|
+
| **Lint / format / test toolchain** | <e.g., oxlint, oxfmt, bun test> |
|
|
35
|
+
| **Target platforms** | <e.g., macOS x64/aarch64, Linux x64/aarch64> |
|
|
36
|
+
| **Source we are porting** | <e.g., codex (../) — see findings/architecture/architecture-map.md> |
|
|
37
|
+
|
|
38
|
+
## System Summary
|
|
39
|
+
|
|
40
|
+
<!-- Restate the system's purpose and scope for the person who will build the new version. -->
|
|
41
|
+
|
|
42
|
+
## Spec Conventions
|
|
43
|
+
|
|
44
|
+
<!-- Up-front so a reader knows how to interpret citations and markers. -->
|
|
45
|
+
|
|
46
|
+
- **Section anchors** are H2 (`##`) and H3 (`###`). Cross-references in the spec use `§<section>`.
|
|
47
|
+
- **Source citations** by phase: `[contracts §X]`, `[protocols §X]`, `[porting Finding N]`,
|
|
48
|
+
`[defect-scan §Pass.N]`.
|
|
49
|
+
- **Evidence levels** appear inline in italic: *observed fact*, *strong inference*,
|
|
50
|
+
*portability hazard*, *open question*.
|
|
51
|
+
- **Revised markers** for post-pipeline delta applications: `[revised per <source> §<delta-id>]`
|
|
52
|
+
(see `skills/spec-delta-application/SKILL.md`).
|
|
53
|
+
- **Required behaviors** are normative. The verb form pins the rule:
|
|
54
|
+
- "MUST" = invariant, fail-build-if-violated.
|
|
55
|
+
- "SHOULD" = strong default; deviation requires justification in DECISIONS.md.
|
|
56
|
+
- "MAY" = permitted; both behaviors are valid.
|
|
57
|
+
|
|
58
|
+
## Named Module Inventory
|
|
59
|
+
|
|
60
|
+
<!--
|
|
61
|
+
Modules have committed names because the stack is locked. List every module the
|
|
62
|
+
reimplementation will produce, in dependency-from-leaf-to-root order.
|
|
63
|
+
-->
|
|
64
|
+
|
|
65
|
+
| Module | Responsibility | Public Inputs | Public Outputs | Owned State | Depends On |
|
|
66
|
+
|---|---|---|---|---|---|
|
|
67
|
+
| <module-name-1> | | | | | |
|
|
68
|
+
| <module-name-2> | | | | | |
|
|
69
|
+
|
|
70
|
+
## Locked Stack
|
|
71
|
+
|
|
72
|
+
<!--
|
|
73
|
+
The opinionated equivalent of "External Dependencies." The answer is given, not chosen.
|
|
74
|
+
List every external dependency with the committed choice and rationale.
|
|
75
|
+
-->
|
|
76
|
+
|
|
77
|
+
| Dependency | Committed Choice | Rationale | Stance (replace/wrap/emulate/postpone source) |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| <e.g., HTTP client> | <e.g., native fetch> | <e.g., Bun ships it; zero-dep target> | replace |
|
|
80
|
+
| <e.g., Sandbox primitive> | <e.g., landlock + seccomp on Linux, sandbox-exec on macOS> | <e.g., kernel-supported> | replace |
|
|
81
|
+
|
|
82
|
+
## Required Behaviors
|
|
83
|
+
|
|
84
|
+
<!-- What the reimplementation must do. Derived from contracts. Use MUST/SHOULD/MAY pinning. -->
|
|
85
|
+
|
|
86
|
+
## Protocols and Persisted State
|
|
87
|
+
|
|
88
|
+
<!-- Wire formats, state machines, and persistence rules that must be preserved.
|
|
89
|
+
Derived from protocols. Cite back to protocols phase by section anchor. -->
|
|
90
|
+
|
|
91
|
+
## Portability Hazards
|
|
92
|
+
|
|
93
|
+
<!-- Risks specific to the locked stack. (In opinionated mode, "portability across stacks" is
|
|
94
|
+
not a concern; "portability across OS targets within the locked stack" usually is.) -->
|
|
95
|
+
|
|
96
|
+
## Implementation Sequence
|
|
97
|
+
|
|
98
|
+
<!-- Suggested build order, named-module by named-module. -->
|
|
99
|
+
|
|
100
|
+
### Module Order
|
|
101
|
+
|
|
102
|
+
1. <module-1> — <one-line: what unblocks after this is done>
|
|
103
|
+
2. <module-2> — ...
|
|
104
|
+
3. ...
|
|
105
|
+
|
|
106
|
+
### Scope Tiers
|
|
107
|
+
|
|
108
|
+
**v0 (minimum viable port):**
|
|
109
|
+
<!-- Which named modules ship in v0; which are tripwire-stubbed (see CONVENTIONS.md). -->
|
|
110
|
+
|
|
111
|
+
**v1 (major-workflow parity):**
|
|
112
|
+
<!-- Which modules promote from stub to real; which new modules land. -->
|
|
113
|
+
|
|
114
|
+
**v2 (full parity):**
|
|
115
|
+
<!-- Final state. -->
|
|
116
|
+
|
|
117
|
+
## Acceptance Scenarios
|
|
118
|
+
|
|
119
|
+
<!--
|
|
120
|
+
Black-box checks with concrete inputs and observable outputs.
|
|
121
|
+
Independent of source-language internals. The acceptance scenarios are the same for both
|
|
122
|
+
language-agnostic and opinionated modes — what differs is the implementation, not the
|
|
123
|
+
observable contract.
|
|
124
|
+
-->
|
|
125
|
+
|
|
126
|
+
| # | Scenario | Input | Expected Output / Side Effect |
|
|
127
|
+
|---|----------|-------|-------------------------------|
|
|
128
|
+
| 1 | | | |
|
|
129
|
+
|
|
130
|
+
## Spike List
|
|
131
|
+
|
|
132
|
+
<!--
|
|
133
|
+
In opinionated mode, the spike list is up-front (the orchestrator usually has identified
|
|
134
|
+
the spikes during strategic alignment). Each spike has a goal, a success criterion, and a
|
|
135
|
+
named scratch directory.
|
|
136
|
+
-->
|
|
137
|
+
|
|
138
|
+
| # | Spike | Goal | Success Criterion | Scratch Path |
|
|
139
|
+
|---|---|---|---|---|
|
|
140
|
+
| 1 | | | | spikes/<id>/ |
|
|
141
|
+
|
|
142
|
+
## Deliberate Non-Goals
|
|
143
|
+
|
|
144
|
+
<!--
|
|
145
|
+
Features intentionally deferred, source-specific UX not worth carrying over,
|
|
146
|
+
integrations that will be stubbed first.
|
|
147
|
+
-->
|
|
148
|
+
|
|
149
|
+
## Known Unknowns
|
|
150
|
+
|
|
151
|
+
<!-- Items that are still genuinely unknown — need a prototype, runtime test, maintainer decision,
|
|
152
|
+
or spec ruling. Same shape as the language-agnostic template. -->
|
|
153
|
+
|
|
154
|
+
| ID | Kind | Description | Deferred Reason |
|
|
155
|
+
|---|---|---|---|
|
|
156
|
+
| | | | |
|
|
157
|
+
|
|
158
|
+
## Carry-Forward
|
|
159
|
+
|
|
160
|
+
<!-- Items deferred to post-pipeline work (spike, delta, amendment).
|
|
161
|
+
Each entry: { id, kind: defer-to-phase, target_phase, description, deferred_reason }. -->
|
|
162
|
+
|
|
163
|
+
| ID | Target Phase | Description | Deferred Reason |
|
|
164
|
+
|---|---|---|---|
|
|
165
|
+
| | | | |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Validation
|
|
170
|
+
|
|
171
|
+
<!-- Fill in this table per workflow/VALIDATE.md. Same criteria as the language-agnostic template;
|
|
172
|
+
the opinionated form changes the body, not the validation rubric. -->
|
|
173
|
+
|
|
174
|
+
| # | Criterion | Result | Evidence |
|
|
175
|
+
|---|-----------|--------|----------|
|
|
176
|
+
| 1 | Concept-level modules are defined. | PASS / PARTIAL / FAIL | |
|
|
177
|
+
| 2 | Required behaviors are stated. | PASS / PARTIAL / FAIL | |
|
|
178
|
+
| 3 | Protocol and persisted state expectations are stated. | PASS / PARTIAL / FAIL | |
|
|
179
|
+
| 4 | Acceptance scenarios and known unknowns are included. | PASS / PARTIAL / FAIL | |
|
|
180
|
+
| 5 | Findings are marked with evidence levels. | PASS / PARTIAL / FAIL | |
|
|
181
|
+
|
|
182
|
+
**Validated by:** [session identifier or date]
|
|
183
|
+
**Overall:** PASS / PASS WITH GAPS / FAIL
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Reimplementation Spec
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Output template for the reimplementation-spec phase.
|
|
5
|
+
This is the final deliverable: a language-agnostic build plan.
|
|
6
|
+
Fill in each section. Remove placeholder text. Keep the section headers.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
## System Summary
|
|
10
|
+
|
|
11
|
+
<!-- Restate the system's purpose and scope for the person who will build the new version. -->
|
|
12
|
+
|
|
13
|
+
## Conceptual Module Model
|
|
14
|
+
|
|
15
|
+
<!--
|
|
16
|
+
For each module:
|
|
17
|
+
- Responsibility (one sentence)
|
|
18
|
+
- Public inputs and outputs
|
|
19
|
+
- Owned state and invariants
|
|
20
|
+
- Collaborators and dependencies
|
|
21
|
+
-->
|
|
22
|
+
|
|
23
|
+
### [Module Name]
|
|
24
|
+
|
|
25
|
+
| Field | Value |
|
|
26
|
+
|---|---|
|
|
27
|
+
| **Responsibility** | |
|
|
28
|
+
| **Public inputs** | |
|
|
29
|
+
| **Public outputs** | |
|
|
30
|
+
| **Owned state** | |
|
|
31
|
+
| **Invariants** | |
|
|
32
|
+
| **Collaborators** | |
|
|
33
|
+
|
|
34
|
+
<!-- Repeat for each module. -->
|
|
35
|
+
|
|
36
|
+
## Layer Split
|
|
37
|
+
|
|
38
|
+
<!--
|
|
39
|
+
Assign each module to one of:
|
|
40
|
+
- core semantics: behavior that must survive the port unchanged
|
|
41
|
+
- adapters: integrations with terminal, browser, filesystem, cloud APIs, SDKs
|
|
42
|
+
- delivery surfaces: CLI, TUI, web, bot, daemon, deployment wrappers
|
|
43
|
+
-->
|
|
44
|
+
|
|
45
|
+
| Module | Layer | Notes |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| | | |
|
|
48
|
+
|
|
49
|
+
## Required Behaviors
|
|
50
|
+
|
|
51
|
+
<!-- What the reimplementation must do. Derived from contracts. -->
|
|
52
|
+
|
|
53
|
+
## Protocols and Persisted State
|
|
54
|
+
|
|
55
|
+
<!-- What wire formats, state machines, and persistence rules must be preserved. Derived from protocols. -->
|
|
56
|
+
|
|
57
|
+
## External Dependencies
|
|
58
|
+
|
|
59
|
+
<!-- For each external dependency, choose a stance. -->
|
|
60
|
+
|
|
61
|
+
| Dependency | Stance (replace/wrap/emulate/postpone) | Rationale |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| | | |
|
|
64
|
+
|
|
65
|
+
## Portability Hazards
|
|
66
|
+
|
|
67
|
+
<!-- Risks specific to the reimplementation effort. -->
|
|
68
|
+
|
|
69
|
+
## Implementation Sequence
|
|
70
|
+
|
|
71
|
+
<!-- Suggested build order. -->
|
|
72
|
+
|
|
73
|
+
### Scope Tiers
|
|
74
|
+
|
|
75
|
+
**Minimum viable port:**
|
|
76
|
+
<!-- What must work for the system to be usable at all. -->
|
|
77
|
+
|
|
78
|
+
**Major-workflow parity:**
|
|
79
|
+
<!-- What must work to cover the primary use cases. -->
|
|
80
|
+
|
|
81
|
+
**Full parity:**
|
|
82
|
+
<!-- Everything the original does. -->
|
|
83
|
+
|
|
84
|
+
## Acceptance Scenarios
|
|
85
|
+
|
|
86
|
+
<!--
|
|
87
|
+
Black-box checks with concrete inputs and observable outputs.
|
|
88
|
+
No references to source-language internals.
|
|
89
|
+
-->
|
|
90
|
+
|
|
91
|
+
| # | Scenario | Input | Expected Output / Side Effect |
|
|
92
|
+
|---|----------|-------|-------------------------------|
|
|
93
|
+
| 1 | | | |
|
|
94
|
+
|
|
95
|
+
## Deliberate Non-Goals
|
|
96
|
+
|
|
97
|
+
<!--
|
|
98
|
+
Features intentionally deferred, source-specific UX not worth carrying over,
|
|
99
|
+
integrations that will be stubbed first.
|
|
100
|
+
-->
|
|
101
|
+
|
|
102
|
+
## Known Unknowns
|
|
103
|
+
|
|
104
|
+
<!-- Items that are still genuinely unknown — need a prototype, runtime test, maintainer decision, or spec ruling.
|
|
105
|
+
This is the reimplementation-spec phase's terminal "open_questions" — items the pipeline can't close
|
|
106
|
+
because they require executing code (a spike) or a decision the orchestrator owns.
|
|
107
|
+
Each entry: { id, kind, description, deferred_reason }. -->
|
|
108
|
+
|
|
109
|
+
| ID | Kind | Description | Deferred Reason |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| | | | |
|
|
112
|
+
|
|
113
|
+
## Carry-Forward
|
|
114
|
+
|
|
115
|
+
<!-- Reimplementation-spec is the terminal phase in most pipelines, so most items belong in Known Unknowns
|
|
116
|
+
above. Use this section only when post-pipeline work (spikes, deltas, amendments) is the right place
|
|
117
|
+
to close an item. Each entry: { id, kind: defer-to-phase, target_phase, description, deferred_reason }.
|
|
118
|
+
Allowed target_phase values for post-pipeline: "spike", "delta", "amendment". -->
|
|
119
|
+
|
|
120
|
+
| ID | Target Phase | Description | Deferred Reason |
|
|
121
|
+
|---|---|---|---|
|
|
122
|
+
| | | | |
|
|
123
|
+
|
|
124
|
+
## Spike List
|
|
125
|
+
|
|
126
|
+
<!--
|
|
127
|
+
- Unknown behaviors that need a prototype
|
|
128
|
+
- Risky performance assumptions
|
|
129
|
+
- Platform-sensitive areas that need targeted tests
|
|
130
|
+
-->
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Validation
|
|
135
|
+
|
|
136
|
+
<!-- Fill in this table per workflow/VALIDATE.md. The rows below match the full pipeline.
|
|
137
|
+
Adjust rows to match your active pipeline's completion_criteria if using a variant. -->
|
|
138
|
+
|
|
139
|
+
| # | Criterion | Result | Evidence |
|
|
140
|
+
|---|-----------|--------|----------|
|
|
141
|
+
| 1 | Concept-level modules are defined. | PASS / PARTIAL / FAIL | |
|
|
142
|
+
| 2 | Required behaviors are stated. | PASS / PARTIAL / FAIL | |
|
|
143
|
+
| 3 | Protocol and persisted state expectations are stated. | PASS / PARTIAL / FAIL | |
|
|
144
|
+
| 4 | Acceptance scenarios and known unknowns are included. | PASS / PARTIAL / FAIL | |
|
|
145
|
+
| 5 | Findings are marked with evidence levels. | PASS / PARTIAL / FAIL | |
|
|
146
|
+
|
|
147
|
+
**Validated by:** [session identifier or date]
|
|
148
|
+
**Overall:** PASS / PASS WITH GAPS / FAIL
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Reverse-Engineering Bundle
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Output template for the porting phase.
|
|
5
|
+
This is a synthesis of architecture, contracts, and protocols.
|
|
6
|
+
Fill in each section. Remove placeholder text. Keep the section headers.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
## System Summary
|
|
10
|
+
|
|
11
|
+
<!-- One to three paragraphs summarizing the system in plain language, aimed at someone who will reimplement it. -->
|
|
12
|
+
|
|
13
|
+
## Layer Map With Ownership
|
|
14
|
+
|
|
15
|
+
<!--
|
|
16
|
+
Synthesized from the architecture phase.
|
|
17
|
+
Each layer/module with its role and what it owns.
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
| Layer / Module | Role | Owns |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| | | |
|
|
23
|
+
|
|
24
|
+
## Feature Contract Table
|
|
25
|
+
|
|
26
|
+
<!--
|
|
27
|
+
Synthesized from the contracts phase.
|
|
28
|
+
Summary table of all features with their priority for porting.
|
|
29
|
+
-->
|
|
30
|
+
|
|
31
|
+
| Feature | Surface | Priority (core/important/optional/incidental) | Key Contracts | Notes |
|
|
32
|
+
|---|---|---|---|---|
|
|
33
|
+
| | | | | |
|
|
34
|
+
|
|
35
|
+
## Protocol and State Notes
|
|
36
|
+
|
|
37
|
+
<!--
|
|
38
|
+
Synthesized from the protocols phase.
|
|
39
|
+
Summary of protocols, state machines, and persistence that a reimplementation must preserve.
|
|
40
|
+
-->
|
|
41
|
+
|
|
42
|
+
## Portability Hazards
|
|
43
|
+
|
|
44
|
+
<!--
|
|
45
|
+
Consolidated from all prior phases.
|
|
46
|
+
Separate from facts — these are risks, not certainties.
|
|
47
|
+
-->
|
|
48
|
+
|
|
49
|
+
| Hazard | Source Phase | Impact | Mitigation |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| | | | |
|
|
52
|
+
|
|
53
|
+
## Defect Synthesis
|
|
54
|
+
|
|
55
|
+
<!--
|
|
56
|
+
Consolidate the defect findings into a single porting view.
|
|
57
|
+
|
|
58
|
+
- For pipelines with a single defect-scan phase (e.g. pipeline-full-with-audit):
|
|
59
|
+
pull from `findings/defect-scan/defect-report.md`.
|
|
60
|
+
- For pipelines with the split scan (e.g. pipeline-full-with-deep-audit):
|
|
61
|
+
pull from BOTH `findings/defect-scan-mechanical/mechanical-defects.md`
|
|
62
|
+
AND `findings/defect-scan-semantic/semantic-defects.md`.
|
|
63
|
+
- For pipelines without a defect scan (e.g. pipeline.yaml or pipeline-lite):
|
|
64
|
+
write "No defect scan ran in this pipeline." and skip the table.
|
|
65
|
+
|
|
66
|
+
This section is the porting-oriented view of defects — it should answer
|
|
67
|
+
"which defects must the reimplementation design around, and how?" not
|
|
68
|
+
re-list every finding. Keep it under one screen.
|
|
69
|
+
-->
|
|
70
|
+
|
|
71
|
+
| Defect ID | Source Report | One-line Description | Severity | Porting Recommendation |
|
|
72
|
+
|-----------|---------------|----------------------|----------|------------------------|
|
|
73
|
+
| | | | | fix before porting / port differently / leave behind |
|
|
74
|
+
|
|
75
|
+
## Observed Facts vs. Inferred Structure
|
|
76
|
+
|
|
77
|
+
<!--
|
|
78
|
+
Explicitly separate what is documented/tested from what was inferred.
|
|
79
|
+
-->
|
|
80
|
+
|
|
81
|
+
### Observed Facts
|
|
82
|
+
|
|
83
|
+
<!-- Direct statements from docs, tests, schemas, types, and code. -->
|
|
84
|
+
|
|
85
|
+
### Inferred Structure
|
|
86
|
+
|
|
87
|
+
<!-- Architectural conclusions drawn from multiple facts. -->
|
|
88
|
+
|
|
89
|
+
## Domain Glossary
|
|
90
|
+
|
|
91
|
+
<!--
|
|
92
|
+
Shared vocabulary of domain-specific terms used across the codebase.
|
|
93
|
+
Include terms that a reimplementer needs to understand, especially:
|
|
94
|
+
- Terms with project-specific meaning that differs from common usage
|
|
95
|
+
- Abbreviations or acronyms used in code and docs
|
|
96
|
+
- Entity names and their relationships
|
|
97
|
+
- Business rules expressed as domain concepts
|
|
98
|
+
-->
|
|
99
|
+
|
|
100
|
+
| Term | Definition | Where Used |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| | | |
|
|
103
|
+
|
|
104
|
+
## Open Questions
|
|
105
|
+
|
|
106
|
+
<!-- Items that are still genuinely unknown — need a runtime test, maintainer decision, or spec ruling.
|
|
107
|
+
NOT items deferred to a later phase in this pipeline (those go in Carry-Forward).
|
|
108
|
+
Each entry: { id, kind, description, deferred_reason }. See workflow/status.yaml schema. -->
|
|
109
|
+
|
|
110
|
+
| ID | Kind | Description | Deferred Reason |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| | | | |
|
|
113
|
+
|
|
114
|
+
## Carry-Forward
|
|
115
|
+
|
|
116
|
+
<!-- Items deferred to a specific later phase whose rubric is the right place to close them.
|
|
117
|
+
Common target from porting: reimplementation-spec (rule-pinning, opinionated decisions).
|
|
118
|
+
Each entry: { id, kind: defer-to-phase, target_phase, description, deferred_reason }.
|
|
119
|
+
Mirror these into workflow/status.yaml under this phase's carry_forward list. -->
|
|
120
|
+
|
|
121
|
+
| ID | Target Phase | Description | Deferred Reason |
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
| | | | |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Validation
|
|
128
|
+
|
|
129
|
+
<!-- Fill in this table per workflow/VALIDATE.md. The rows below match the full pipeline.
|
|
130
|
+
Adjust rows to match your active pipeline's completion_criteria if using a variant. -->
|
|
131
|
+
|
|
132
|
+
| # | Criterion | Result | Evidence |
|
|
133
|
+
|---|-----------|--------|----------|
|
|
134
|
+
| 1 | The system summary, layer map, contract table, protocol notes, and porting findings are synthesized. | PASS / PARTIAL / FAIL | |
|
|
135
|
+
| 2 | Portability hazards and open questions are separated from facts. | PASS / PARTIAL / FAIL | |
|
|
136
|
+
| 3 | Feature importance is sorted for porting. | PASS / PARTIAL / FAIL | |
|
|
137
|
+
| 4 | Known defects are referenced in the Defect Synthesis with porting recommendations (fix before porting / port differently / leave behind), or the section explicitly notes that no defect scan ran. | PASS / PARTIAL / FAIL | |
|
|
138
|
+
| 5 | Findings are marked with evidence levels. | PASS / PARTIAL / FAIL | |
|
|
139
|
+
|
|
140
|
+
**Validated by:** [session identifier or date]
|
|
141
|
+
**Overall:** PASS / PASS WITH GAPS / FAIL
|