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.
Files changed (75) hide show
  1. package/.codecarto/BACKLOG.md +192 -0
  2. package/.codecarto/CHANGELOG-2026-05-02-feedback-pass.md +118 -0
  3. package/.codecarto/CONTRIBUTING.md +56 -0
  4. package/.codecarto/GUIDE.md +298 -0
  5. package/.codecarto/LICENSE +21 -0
  6. package/.codecarto/NEW_THREAD_BLURB.md +47 -0
  7. package/.codecarto/README.md +39 -0
  8. package/.codecarto/THREAD_LOG.md +39 -0
  9. package/.codecarto/closeouts/2026-05-02-framework-feedback-pass.md +111 -0
  10. package/.codecarto/findings/architecture/README.md +3 -0
  11. package/.codecarto/findings/architecture/SKILL.md +102 -0
  12. package/.codecarto/findings/build-and-deploy/.gitkeep +0 -0
  13. package/.codecarto/findings/config-model/.gitkeep +0 -0
  14. package/.codecarto/findings/contracts/README.md +3 -0
  15. package/.codecarto/findings/contracts/SKILL.md +89 -0
  16. package/.codecarto/findings/defect-scan/README.md +18 -0
  17. package/.codecarto/findings/defect-scan/SKILL.md +87 -0
  18. package/.codecarto/findings/defect-scan/passes/01-logic-and-correctness.md +50 -0
  19. package/.codecarto/findings/defect-scan/passes/02-error-handling.md +55 -0
  20. package/.codecarto/findings/defect-scan/passes/03-concurrency-and-resources.md +54 -0
  21. package/.codecarto/findings/defect-scan/passes/04-security-and-trust.md +62 -0
  22. package/.codecarto/findings/defect-scan/passes/05-api-contract-violations.md +57 -0
  23. package/.codecarto/findings/defect-scan/passes/06-config-and-environment.md +58 -0
  24. package/.codecarto/findings/defect-scan-mechanical/README.md +17 -0
  25. package/.codecarto/findings/defect-scan-mechanical/SKILL.md +60 -0
  26. package/.codecarto/findings/defect-scan-semantic/README.md +17 -0
  27. package/.codecarto/findings/defect-scan-semantic/SKILL.md +54 -0
  28. package/.codecarto/findings/porting/README.md +3 -0
  29. package/.codecarto/findings/porting/SKILL.md +52 -0
  30. package/.codecarto/findings/protocols/README.md +3 -0
  31. package/.codecarto/findings/protocols/SKILL.md +87 -0
  32. package/.codecarto/findings/public-surfaces/README.md +3 -0
  33. package/.codecarto/findings/reimplementation-spec/README.md +3 -0
  34. package/.codecarto/findings/reimplementation-spec/SKILL.md +66 -0
  35. package/.codecarto/findings/runtime-lifecycle/README.md +3 -0
  36. package/.codecarto/findings/state-and-storage/README.md +3 -0
  37. package/.codecarto/scratch/.gitkeep +0 -0
  38. package/.codecarto/skills/spec-delta-application/SKILL.md +102 -0
  39. package/.codecarto/templates/architecture-map.md +143 -0
  40. package/.codecarto/templates/behavioral-contracts.md +134 -0
  41. package/.codecarto/templates/closeout-template.md +85 -0
  42. package/.codecarto/templates/conventions-template.md +65 -0
  43. package/.codecarto/templates/decisions-template.md +82 -0
  44. package/.codecarto/templates/defect-fix-tracker.md +77 -0
  45. package/.codecarto/templates/defect-report.md +116 -0
  46. package/.codecarto/templates/deltas-applied.md +71 -0
  47. package/.codecarto/templates/mechanical-defects.md +104 -0
  48. package/.codecarto/templates/protocols-and-state.md +126 -0
  49. package/.codecarto/templates/reimplementation-spec-opinionated.md +183 -0
  50. package/.codecarto/templates/reimplementation-spec.md +148 -0
  51. package/.codecarto/templates/reverse-engineering-bundle.md +141 -0
  52. package/.codecarto/templates/semantic-defects.md +109 -0
  53. package/.codecarto/templates/thread-log-entry-template.md +27 -0
  54. package/.codecarto/workflow/VALIDATE.md +81 -0
  55. package/.codecarto/workflow/pipeline-architecture-only.yaml +38 -0
  56. package/.codecarto/workflow/pipeline-defect-scan.yaml +61 -0
  57. package/.codecarto/workflow/pipeline-full-with-audit.yaml +188 -0
  58. package/.codecarto/workflow/pipeline-full-with-deep-audit.yaml +227 -0
  59. package/.codecarto/workflow/pipeline-lite.yaml +100 -0
  60. package/.codecarto/workflow/pipeline.yaml +163 -0
  61. package/.codecarto/workflow/status.yaml +64 -0
  62. package/LICENSE +21 -0
  63. package/README.md +356 -0
  64. package/core/index.ts +11 -0
  65. package/core/pipeline.ts +175 -0
  66. package/core/prompts.ts +183 -0
  67. package/core/status.ts +155 -0
  68. package/core/types.ts +96 -0
  69. package/core/utils.ts +52 -0
  70. package/core/workspace.ts +81 -0
  71. package/core/yaml.ts +256 -0
  72. package/extensions/codecarto/index.ts +446 -0
  73. package/mcp-server/bin.mjs +7 -0
  74. package/mcp-server/server.ts +497 -0
  75. package/package.json +52 -0
@@ -0,0 +1,109 @@
1
+ # Semantic Defects Report — [project_name]
2
+
3
+ <!--
4
+ Output template for the `defect-scan-semantic` phase.
5
+ Covers passes 3, 4, and 5 from the defect-scan methodology — the bugs that
6
+ need contracts and protocols context to spot reliably.
7
+ See findings/defect-scan-semantic/SKILL.md for instructions.
8
+ -->
9
+
10
+ ## Scan Context
11
+
12
+ - **Source:** `../` (repository root)
13
+ - **Architecture reference:** `findings/architecture/architecture-map.md`
14
+ - **Contracts reference:** `findings/contracts/behavioral-contracts.md`
15
+ - **Protocols reference:** `findings/protocols/protocols-and-state.md`
16
+ - **Mechanical defects reference:** `findings/defect-scan-mechanical/mechanical-defects.md`
17
+ - **Pipeline:** [pipeline variant name]
18
+ - **Date:** [date]
19
+ - **Scope:** Semantic passes only (3 concurrency, 4 security, 5 contract violations). Mechanical passes (1 logic, 2 error handling, 6 configuration) were covered earlier in `defect-scan-mechanical`.
20
+
21
+ ---
22
+
23
+ ## Pass 3: Concurrency and Resource Management
24
+
25
+ <!-- For each finding: location, defect, evidence, severity, evidence level, action. -->
26
+ <!-- Cite the protocol or state-machine entry that the finding violates, when relevant. -->
27
+ <!-- If no findings, write "No defects found in this category." -->
28
+
29
+ | # | Location | Defect | Severity | Evidence Level | Action |
30
+ |---|----------|--------|----------|----------------|--------|
31
+ | 1 | | | | | |
32
+
33
+ ---
34
+
35
+ ## Pass 4: Security and Trust Boundaries
36
+
37
+ <!-- Cite the contract entry (e.g., feature ID) that the finding violates, when relevant. -->
38
+
39
+ | # | Location | Defect | Severity | Evidence Level | Action |
40
+ |---|----------|--------|----------|----------------|--------|
41
+ | 1 | | | | | |
42
+
43
+ ---
44
+
45
+ ## Pass 5: API Contract Violations
46
+
47
+ <!-- Each finding should pair the source contract/protocol reference with the diverging code location. -->
48
+
49
+ | # | Location | Defect | Severity | Evidence Level | Action | Spec Reference |
50
+ |---|----------|--------|----------|----------------|--------|----------------|
51
+ | 1 | | | | | | |
52
+
53
+ ---
54
+
55
+ ## Summary
56
+
57
+ ### Findings by Severity
58
+
59
+ | Severity | Count |
60
+ |----------|-------|
61
+ | Critical | |
62
+ | High | |
63
+ | Medium | |
64
+ | Low | |
65
+ | **Total** | |
66
+
67
+ ### Findings by Pass
68
+
69
+ | Pass | Critical | High | Medium | Low | Total |
70
+ |------|----------|------|--------|-----|-------|
71
+ | 3. Concurrency and resources | | | | | |
72
+ | 4. Security and trust | | | | | |
73
+ | 5. API contract violations | | | | | |
74
+
75
+ ### Top Findings
76
+
77
+ <!-- List the most impactful findings across the semantic passes, ranked by severity and confidence.
78
+ Include: pass number, location, one-line defect description, severity, recommended action. -->
79
+
80
+ 1.
81
+ 2.
82
+ 3.
83
+ 4.
84
+ 5.
85
+
86
+ ### Carry-Forward Closure
87
+
88
+ <!-- carry_forward entries in status.yaml that targeted defect-scan-semantic and were closed here. -->
89
+
90
+ | ID | Source Phase | Closed Because |
91
+ |----|--------------|---------------|
92
+ | | | |
93
+
94
+ ---
95
+
96
+ ## Validation
97
+
98
+ <!-- Fill in this table per workflow/VALIDATE.md. The rows below match the semantic-pass scope. -->
99
+
100
+ | # | Criterion | Result | Evidence |
101
+ |---|-----------|--------|----------|
102
+ | 1 | All three semantic passes (3, 4, 5) produced findings or documented "no defects found." | PASS / PARTIAL / FAIL | |
103
+ | 2 | Each finding has location, severity, evidence level, and recommended action. | PASS / PARTIAL / FAIL | |
104
+ | 3 | Pass 5 findings cite the contract or protocol reference they violate. | PASS / PARTIAL / FAIL | |
105
+ | 4 | Findings are organized by pass and sorted by severity; summary tables match the detailed findings. | PASS / PARTIAL / FAIL | |
106
+ | 5 | Findings are marked with evidence levels. | PASS / PARTIAL / FAIL | |
107
+
108
+ **Validated by:** [session identifier or date]
109
+ **Overall:** PASS / PASS WITH GAPS / FAIL
@@ -0,0 +1,27 @@
1
+ # THREAD_LOG.md Entry Template (legacy / one-line index form)
2
+
3
+ This template is the **one-line index entry** appended to `THREAD_LOG.md` per session.
4
+ The full body of each session lives in a separate closeout file under `closeouts/`.
5
+
6
+ For the closeout file itself, use `templates/closeout-template.md`.
7
+
8
+ ## Entry format
9
+
10
+ ```
11
+ - YYYY-MM-DD — <phase-or-module> — <one-line-summary> — [closeout](closeouts/YYYY-MM-DD-phase-or-module.md)
12
+ ```
13
+
14
+ ## Example
15
+
16
+ ```
17
+ - 2026-05-02 — architecture — mapped 14 packages across 3 layers; 2 carry-forward items routed to defect-scan — [closeout](closeouts/2026-05-02-architecture.md)
18
+ ```
19
+
20
+ ## Rules
21
+
22
+ - One line per session, no exceptions.
23
+ - Date in ISO format (YYYY-MM-DD).
24
+ - `<phase-or-module>` matches the closeout filename's slug.
25
+ - Summary is one clause, no more than ~20 words.
26
+ - Always link to the closeout file. If there is no closeout file, the entry doesn't belong here.
27
+ - Before appending, scan the bottom 5 entries to avoid duplicating a prior session's entry.
@@ -0,0 +1,81 @@
1
+ # Phase Validation
2
+
3
+ Run this check after completing a phase's primary output, before marking the phase as complete.
4
+
5
+ ## Steps
6
+
7
+ 1. Re-read the phase's `completion_criteria` from the active pipeline YAML (check the `pipeline` field in `workflow/status.yaml` for the file path).
8
+ 2. Re-read the primary output you just produced.
9
+ 3. For each criterion, answer one of:
10
+ - **PASS**: the output clearly satisfies this criterion. Cite the section or line.
11
+ - **PARTIAL**: the output addresses this but is incomplete or shallow. State what is missing.
12
+ - **FAIL**: the output does not address this criterion at all.
13
+ 4. Append a validation block to the end of the primary output file (see format below).
14
+ 5. If any criterion is FAIL, do not mark the phase as complete. Fix the output first.
15
+ 6. If any criterion is PARTIAL, route the gap appropriately:
16
+ - If the gap is **still genuinely unknown** (needs a runtime test, maintainer decision, or spec ruling that no later phase will close), record it under `open_questions` for the phase in `workflow/status.yaml`.
17
+ - If the gap is **deferred to a specific later phase** in this pipeline (the next phase's rubric is the right place to close it), record it under `carry_forward` with an explicit `target_phase` field. See GUIDE.md "Open Questions vs Carry-Forward" for the entry shape.
18
+ - You may still mark the phase complete if the gaps are documented under one of the two lists and are non-blocking for downstream phases.
19
+
20
+ ## Validation Block Format
21
+
22
+ Append this to the end of every primary output file:
23
+
24
+ ```markdown
25
+ ---
26
+
27
+ ## Validation
28
+
29
+ | # | Criterion | Result | Evidence |
30
+ |---|-----------|--------|----------|
31
+ | 1 | [criterion text from pipeline.yaml] | PASS / PARTIAL / FAIL | [section reference or note] |
32
+ | 2 | ... | ... | ... |
33
+
34
+ **Validated by:** [session identifier or date]
35
+ **Overall:** PASS / PASS WITH GAPS / FAIL
36
+ ```
37
+
38
+ ## Worked PARTIAL Example
39
+
40
+ Below is what a real PASS WITH GAPS block looks like — useful when a phase finishes meaningful work but is honest about its incompleteness. Note how the PARTIAL row's `Evidence` cell *names what is missing*, not just "incomplete."
41
+
42
+ ```markdown
43
+ ---
44
+
45
+ ## Validation
46
+
47
+ | # | Criterion | Result | Evidence |
48
+ |---|-----------|--------|----------|
49
+ | 1 | The system intent is documented. | PASS | §System Intent (paragraph). |
50
+ | 2 | The layer map and dependency direction are documented. | PASS | §Layer Map; dependency direction in §Layer Map → "Dependency Direction." |
51
+ | 3 | Public surfaces are identified. | PARTIAL | CLI commands and HTTP routes enumerated (§Public Surfaces). MCP server endpoints and the websocket subscription channel are listed by name only — schemas not extracted. Routed to `carry_forward` as `arch-CF2` with `target_phase: protocols`. |
52
+ | 4 | Runtime lifecycle, concurrency model, and porting priorities are summarized. | PASS | §Runtime Lifecycle, §Concurrency Model, §Porting Priorities (table). |
53
+ | 5 | Findings are marked with evidence levels. | PASS | All inferences marked `observed fact` / `strong inference` / `portability hazard` / `open question`. |
54
+
55
+ **Validated by:** 2026-05-02 (architecture phase, session 1)
56
+ **Overall:** PASS WITH GAPS
57
+ ```
58
+
59
+ The `arch-CF2` entry then appears in `workflow/status.yaml` under the architecture phase's `carry_forward`:
60
+
61
+ ```yaml
62
+ phases:
63
+ architecture:
64
+ carry_forward:
65
+ - id: arch-CF2
66
+ kind: defer-to-phase
67
+ target_phase: protocols
68
+ description: MCP server endpoints and websocket subscription channel listed by name only; schemas not extracted.
69
+ deferred_reason: Wire-format extraction is the protocols phase's rubric; deferring avoids guessing at shapes here.
70
+ ```
71
+
72
+ The protocols phase, on session start, scans `carry_forward` entries with `target_phase: protocols`, picks `arch-CF2` up, and either resolves it (deletes the entry once the schemas are pinned) or re-defers to a later phase.
73
+
74
+ ## Rules
75
+
76
+ - Do not skip validation. Every primary output must end with a validation block.
77
+ - Do not inflate results. A criterion you are uncertain about is PARTIAL, not PASS.
78
+ - If the output file already has a validation block from a prior session, replace it with a fresh one.
79
+ - Validation checks the output against the pipeline's criteria only. It does not re-evaluate the source code.
80
+ - For automated agents: a phase with any FAIL result must not have its status set to `complete` in status.yaml.
81
+ - A PARTIAL row's `Evidence` cell must name what is missing and (if applicable) which `open_questions` or `carry_forward` entry tracks the gap. "Incomplete" alone is not honest enough.
@@ -0,0 +1,38 @@
1
+ workflow_name: codebase-architecture-scan
2
+ workflow_version: 3
3
+ workflow_goal: Produce an architecture map for an unfamiliar source repository.
4
+ source_location: ../
5
+ validation_protocol: workflow/VALIDATE.md
6
+ phase_order:
7
+ - architecture
8
+ phases:
9
+ - id: architecture
10
+ purpose: Build the layer map, dependency direction, public surfaces, and high-level system structure.
11
+ skill_path: findings/architecture/SKILL.md
12
+ output_template: templates/architecture-map.md
13
+ depends_on: []
14
+ primary_output: findings/architecture/architecture-map.md
15
+ secondary_outputs:
16
+ - path: findings/public-surfaces/public-surfaces.md
17
+ mode: append
18
+ - path: findings/runtime-lifecycle/runtime-lifecycle.md
19
+ mode: append
20
+ - path: findings/state-and-storage/state-and-storage.md
21
+ mode: append
22
+ - path: findings/build-and-deploy/build-and-deploy.md
23
+ mode: append
24
+ - path: findings/config-model/config-model.md
25
+ mode: append
26
+ required_reads:
27
+ - GUIDE.md
28
+ - workflow/status.yaml
29
+ completion_criteria:
30
+ - The system intent is documented.
31
+ - The layer map and dependency direction are documented.
32
+ - Public surfaces are identified.
33
+ - Runtime lifecycle, concurrency model, and porting priorities are summarized.
34
+ - Findings are marked with evidence levels.
35
+ handoff_requirements:
36
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
37
+ - Update workflow/status.yaml.
38
+ - Append a summary entry to THREAD_LOG.md.
@@ -0,0 +1,61 @@
1
+ workflow_name: codebase-defect-scan
2
+ workflow_version: 3
3
+ workflow_goal: Produce an architecture map and a multi-pass defect report for a codebase under active maintenance.
4
+ source_location: ../
5
+ validation_protocol: workflow/VALIDATE.md
6
+ phase_order:
7
+ - architecture
8
+ - defect-scan
9
+ phases:
10
+ - id: architecture
11
+ purpose: Build the layer map, dependency direction, public surfaces, and high-level system structure.
12
+ skill_path: findings/architecture/SKILL.md
13
+ output_template: templates/architecture-map.md
14
+ depends_on: []
15
+ primary_output: findings/architecture/architecture-map.md
16
+ secondary_outputs:
17
+ - path: findings/public-surfaces/public-surfaces.md
18
+ mode: append
19
+ - path: findings/runtime-lifecycle/runtime-lifecycle.md
20
+ mode: append
21
+ - path: findings/state-and-storage/state-and-storage.md
22
+ mode: append
23
+ - path: findings/build-and-deploy/build-and-deploy.md
24
+ mode: append
25
+ - path: findings/config-model/config-model.md
26
+ mode: append
27
+ required_reads:
28
+ - GUIDE.md
29
+ - workflow/status.yaml
30
+ completion_criteria:
31
+ - The system intent is documented.
32
+ - The layer map and dependency direction are documented.
33
+ - Public surfaces are identified.
34
+ - Runtime lifecycle, concurrency model, and porting priorities are summarized.
35
+ - Findings are marked with evidence levels.
36
+ handoff_requirements:
37
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
38
+ - Update workflow/status.yaml.
39
+ - Append a summary entry to THREAD_LOG.md.
40
+ - id: defect-scan
41
+ purpose: Run a multi-pass defect scan to identify bugs, security issues, and code quality problems for maintenance prioritization.
42
+ skill_path: findings/defect-scan/SKILL.md
43
+ output_template: templates/defect-report.md
44
+ depends_on:
45
+ - architecture
46
+ primary_output: findings/defect-scan/defect-report.md
47
+ secondary_outputs: []
48
+ required_reads:
49
+ - GUIDE.md
50
+ - workflow/status.yaml
51
+ - findings/architecture/architecture-map.md
52
+ completion_criteria:
53
+ - At least three analysis passes produced findings or documented "no defects found."
54
+ - Each finding has location, severity, evidence level, and recommended action.
55
+ - Findings are organized by pass and sorted by severity.
56
+ - Summary tables are complete and counts match the detailed findings.
57
+ - Findings are marked with evidence levels.
58
+ handoff_requirements:
59
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
60
+ - Update workflow/status.yaml.
61
+ - Append a summary entry to THREAD_LOG.md.
@@ -0,0 +1,188 @@
1
+ workflow_name: codebase-reverse-engineering-with-audit
2
+ workflow_version: 3
3
+ workflow_goal: Produce a reusable reverse-engineering bundle with a defect scan, so legacy bugs can be identified before porting.
4
+ source_location: ../
5
+ validation_protocol: workflow/VALIDATE.md
6
+ phase_order:
7
+ - architecture
8
+ - defect-scan
9
+ - contracts
10
+ - protocols
11
+ - porting
12
+ - reimplementation-spec
13
+ phases:
14
+ - id: architecture
15
+ purpose: Build the layer map, dependency direction, public surfaces, and high-level system structure.
16
+ skill_path: findings/architecture/SKILL.md
17
+ output_template: templates/architecture-map.md
18
+ depends_on: []
19
+ primary_output: findings/architecture/architecture-map.md
20
+ secondary_outputs:
21
+ - path: findings/public-surfaces/public-surfaces.md
22
+ mode: append
23
+ - path: findings/runtime-lifecycle/runtime-lifecycle.md
24
+ mode: append
25
+ - path: findings/state-and-storage/state-and-storage.md
26
+ mode: append
27
+ - path: findings/build-and-deploy/build-and-deploy.md
28
+ mode: append
29
+ - path: findings/config-model/config-model.md
30
+ mode: append
31
+ required_reads:
32
+ - GUIDE.md
33
+ - workflow/status.yaml
34
+ completion_criteria:
35
+ - The system intent is documented.
36
+ - The layer map and dependency direction are documented.
37
+ - Public surfaces are identified.
38
+ - Runtime lifecycle, concurrency model, and porting priorities are summarized.
39
+ - Findings are marked with evidence levels.
40
+ handoff_requirements:
41
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
42
+ - Update workflow/status.yaml.
43
+ - Append a summary entry to THREAD_LOG.md.
44
+ - id: defect-scan
45
+ purpose: Run a multi-pass defect scan to identify legacy bugs, security issues, and code quality problems before porting.
46
+ skill_path: findings/defect-scan/SKILL.md
47
+ output_template: templates/defect-report.md
48
+ depends_on:
49
+ - architecture
50
+ primary_output: findings/defect-scan/defect-report.md
51
+ secondary_outputs: []
52
+ required_reads:
53
+ - GUIDE.md
54
+ - workflow/status.yaml
55
+ - findings/architecture/architecture-map.md
56
+ completion_criteria:
57
+ - At least three analysis passes produced findings or documented "no defects found."
58
+ - Each finding has location, severity, evidence level, and recommended action.
59
+ - Findings are organized by pass and sorted by severity.
60
+ - Summary tables are complete and counts match the detailed findings.
61
+ - Findings are marked with evidence levels.
62
+ handoff_requirements:
63
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
64
+ - Update workflow/status.yaml.
65
+ - Append a summary entry to THREAD_LOG.md.
66
+ - id: contracts
67
+ purpose: Recover user-visible behavior, defaults, side effects, error behavior, and black-box acceptance checks.
68
+ skill_path: findings/contracts/SKILL.md
69
+ output_template: templates/behavioral-contracts.md
70
+ depends_on:
71
+ - architecture
72
+ primary_output: findings/contracts/behavioral-contracts.md
73
+ secondary_outputs:
74
+ - path: findings/public-surfaces/public-surfaces.md
75
+ mode: append
76
+ - path: findings/runtime-lifecycle/runtime-lifecycle.md
77
+ mode: append
78
+ - path: findings/state-and-storage/state-and-storage.md
79
+ mode: append
80
+ - path: findings/config-model/config-model.md
81
+ mode: append
82
+ required_reads:
83
+ - GUIDE.md
84
+ - workflow/status.yaml
85
+ - findings/architecture/architecture-map.md
86
+ completion_criteria:
87
+ - User-facing surfaces are split by surface type.
88
+ - Feature contracts record trigger, defaults, outputs, side effects, persisted state, error behavior, and recovery behavior.
89
+ - Security and authorization model is documented (if applicable).
90
+ - Contract ownership is mapped back to a layer or package.
91
+ - A black-box acceptance list is included.
92
+ - Findings are marked with evidence levels.
93
+ handoff_requirements:
94
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
95
+ - Update workflow/status.yaml.
96
+ - Append a summary entry to THREAD_LOG.md.
97
+ - id: protocols
98
+ purpose: Capture event catalogs, state machines, persistence formats, and compatibility hazards.
99
+ skill_path: findings/protocols/SKILL.md
100
+ output_template: templates/protocols-and-state.md
101
+ depends_on:
102
+ - architecture
103
+ primary_output: findings/protocols/protocols-and-state.md
104
+ secondary_outputs:
105
+ - path: findings/public-surfaces/public-surfaces.md
106
+ mode: append
107
+ - path: findings/runtime-lifecycle/runtime-lifecycle.md
108
+ mode: append
109
+ - path: findings/state-and-storage/state-and-storage.md
110
+ mode: append
111
+ - path: findings/config-model/config-model.md
112
+ mode: append
113
+ required_reads:
114
+ - GUIDE.md
115
+ - workflow/status.yaml
116
+ - findings/architecture/architecture-map.md
117
+ completion_criteria:
118
+ - An event catalog is documented.
119
+ - A state machine is documented.
120
+ - Persistent schema notes are documented.
121
+ - Compatibility hazards are documented.
122
+ - Findings are marked with evidence levels.
123
+ handoff_requirements:
124
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
125
+ - Update workflow/status.yaml.
126
+ - Append a summary entry to THREAD_LOG.md.
127
+ - id: porting
128
+ purpose: Synthesize architecture, contracts, protocols, and defect findings into a reverse-engineering bundle oriented toward porting.
129
+ skill_path: findings/porting/SKILL.md
130
+ output_template: templates/reverse-engineering-bundle.md
131
+ depends_on:
132
+ - architecture
133
+ - contracts
134
+ - protocols
135
+ primary_output: findings/porting/reverse-engineering-bundle.md
136
+ secondary_outputs:
137
+ - path: findings/public-surfaces/public-surfaces.md
138
+ mode: append
139
+ - path: findings/runtime-lifecycle/runtime-lifecycle.md
140
+ mode: append
141
+ - path: findings/state-and-storage/state-and-storage.md
142
+ mode: append
143
+ - path: findings/build-and-deploy/build-and-deploy.md
144
+ mode: append
145
+ - path: findings/config-model/config-model.md
146
+ mode: append
147
+ required_reads:
148
+ - GUIDE.md
149
+ - workflow/status.yaml
150
+ - findings/architecture/architecture-map.md
151
+ - findings/contracts/behavioral-contracts.md
152
+ - findings/protocols/protocols-and-state.md
153
+ - findings/defect-scan/defect-report.md
154
+ completion_criteria:
155
+ - The system summary, layer map, contract table, protocol notes, and porting findings are synthesized.
156
+ - Portability hazards and open questions are separated from facts.
157
+ - Feature importance is sorted for porting.
158
+ - Known defects are referenced with porting recommendations (fix before porting / port differently / leave behind).
159
+ - Findings are marked with evidence levels.
160
+ handoff_requirements:
161
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
162
+ - Update workflow/status.yaml.
163
+ - Append a summary entry to THREAD_LOG.md.
164
+ - id: reimplementation-spec
165
+ purpose: Produce the final language-agnostic reimplementation plan and acceptance spec.
166
+ skill_path: findings/reimplementation-spec/SKILL.md
167
+ output_template: templates/reimplementation-spec.md
168
+ depends_on:
169
+ - porting
170
+ primary_output: findings/reimplementation-spec/reimplementation-spec.md
171
+ secondary_outputs: []
172
+ required_reads:
173
+ - GUIDE.md
174
+ - workflow/status.yaml
175
+ - findings/architecture/architecture-map.md
176
+ - findings/contracts/behavioral-contracts.md
177
+ - findings/protocols/protocols-and-state.md
178
+ - findings/porting/reverse-engineering-bundle.md
179
+ completion_criteria:
180
+ - Concept-level modules are defined.
181
+ - Required behaviors are stated.
182
+ - Protocol and persisted state expectations are stated.
183
+ - Acceptance scenarios and known unknowns are included.
184
+ - Findings are marked with evidence levels.
185
+ handoff_requirements:
186
+ - Run validation per workflow/VALIDATE.md. Append validation block to primary output.
187
+ - Update workflow/status.yaml.
188
+ - Append a summary entry to THREAD_LOG.md.