Migration readiness — sibling tools/ and root scripts
Survey of the 33 Python scripts in the four sibling repositories that
weren’t part of the disasm_tools/ package consolidation, conducted
2026-05-01. Goal: determine how close fantasm is to subsuming the
sibling tooling so the four projects can drop their bundled
disasm_tools/ and (where appropriate) their workflow scripts and
depend on fantasm.
Each script gets one of:
fantasm-covered — capability is in fantasm; sibling can drop after migration.
port-to-fantasm — generic capability worth lifting into
fantasm.api; new fantasm work required.cli-gap — primitive exists in
fantasm.apibut no CLI command exposes the workflow these scripts encode.project-specific — stays in the sibling repo; one-off fixup, workflow orchestration, or domain-specific ingestion.
Per-script verdict
acorn-adfs/tools/
Script |
Lines |
Purpose |
Verdict |
|---|---|---|---|
|
80 |
Cross-reference uncommented regions with named callees/callers/workspace accesses |
port-to-fantasm |
|
211 |
Identify uncommented basic blocks with predecessor / successor relationships |
port-to-fantasm |
|
76 |
Extract block comments from J.G. Harston’s ADFS 1.30 BBC BASIC source |
project-specific |
|
114 |
Extract symbols from ld65 debug file |
project-specific |
|
82 |
Find doubled inline comments |
fantasm-covered ( |
|
133 |
Generate label() calls from ld65 debug symbols |
project-specific |
|
90 |
Import labels from Hoglet’s BeebAsm disassembly |
project-specific |
|
107 |
Cross-reference multi-target labels against ADFS 1.30 ROM |
project-specific |
|
57 |
Extract label usage context |
fantasm-covered ( |
|
119 |
Remove manual comments duplicating py8dis auto text |
fantasm-covered ( |
|
166 |
Extract subroutine calling-convention context |
port-to-fantasm |
|
146 |
Pattern-based comment suggestions for uncommented instructions |
port-to-fantasm |
|
109 |
Workspace-label usage context |
fantasm-covered ( |
acorn-econet-bridge/tools/
Script |
Lines |
Purpose |
Verdict |
|---|---|---|---|
|
123 |
Find shared opcodes vs sibling-repo ROMs |
fantasm-covered ( |
|
271 |
Scan all sibling ROMs, merge results into JSON |
fantasm-covered ( |
|
189 |
Render shared-code JSON as Markdown |
project-specific |
acorn-nfs/tools/
Script |
Lines |
Purpose |
Verdict |
|---|---|---|---|
|
532 |
Diff annotations between two NFS versions |
cli-gap |
|
480 |
Diff annotations across three NFS versions |
cli-gap |
|
495 |
Report semantic-label inconsistencies across NFS versions |
cli-gap |
|
143 |
Map source labels to target ROM via opcode fingerprinting |
cli-gap |
|
222 |
Find comment() calls pointing to non-instruction addresses |
fantasm-covered ( |
|
669 |
Resolve stale comments via opcode fingerprinting + cross-version |
cli-gap (or close cousin of |
acorn-nfs/ (root level)
Script |
Lines |
Purpose |
Verdict |
|---|---|---|---|
|
330 |
Map 3.35K addresses from earlier versions via merged JSON maps |
project-specific |
|
~360–530 each |
Bootstrap each version’s py8dis driver from the previous version via opcode mapping |
project-specific (workflow orchestration) |
|
96 |
Render NFS README from Jinja template |
project-specific |
|
266 |
Side-by-side disassembly of UNMAPPED regions |
project-specific |
|
~455 each |
Resolve UNMAPPED annotations via interpolation + fingerprinting |
project-specific |
Capability gaps
1. port-to-fantasm — new api work (4 items)
These four scripts encode genuine generic capability that fantasm hasn’t subsumed yet. All ADFS-originated, but each is project-agnostic in shape.
Capability |
Sibling source |
Where it would land |
|---|---|---|
Uncommented-region context analysis (callees / callers / workspace accesses around uncommented gaps) |
|
|
Basic-block identification with annotation-coverage stats |
|
|
Subroutine calling-convention extraction (entry, callers, exits, post-call sites) |
|
Extension to existing |
Pattern-based comment suggestion for uncommented instructions |
|
|
Estimate: ~600 LOC of api code + ~150 LOC of CLI integration + tests.
2. cli-gap — exposing existing primitives (5 items)
These scripts encode workflows whose underlying primitives are already
in fantasm.api. They need CLI commands, not new api work.
Workflow |
Sibling source |
Sketch |
|---|---|---|
Cross-version annotation diff / inconsistency report |
|
|
Cross-version semantic-label consistency |
|
Subset of the above, filtering auto-generated labels via |
Pairwise address mapping export |
|
|
Comment-address rewriting via fingerprinting |
|
A |
Estimate: ~250 LOC of CLI + tests; no api changes needed.
3. fantasm-covered (drop after migration, ~5 items)
find_duplicate_comments.py, remove_duplicate_comments.py,
label_context.py, wksp_label_context.py, find_stale_comments.py,
find_shared_with_siblings.py, refresh_shared_code.py (the
shared-finding part). The siblings can delete these once they switch
to fantasm.
4. project-specific (~17 items)
The eleven generate_*.py driver-translation scripts, the four ADFS
multi-target / Hoglet / JGH ingestion scripts, the two
resolve_unmapped_*.py investigation tools, investigate_360.py,
fix_335k_comments.py, render_shared_code.py, and each project’s
own README generator. These stay where they are. Several of them
could eventually move to fantasm with enough generalisation, but
that’s a generalisation task per script, not a migration blocker.
Migration readiness verdict
Status: ready (with one optional refinement deferred). All four
ports and three of four CLI gaps have landed; the remaining
backfill --apply is a refinement on existing behaviour rather than
a missing capability.
Closed
Item |
Lands as |
Status |
|---|---|---|
Cross-reference uncommented gaps with cfg context ( |
|
✅ done |
Basic-block boundaries + coverage stats ( |
|
✅ done |
Subroutine calling-convention extraction ( |
|
✅ done |
Pattern-based comment suggestions ( |
|
✅ done |
Cross-version annotation diff ( |
|
✅ done |
Pairwise address mapping export ( |
|
✅ done |
Deferred (not blocking)
Item |
Sibling source |
Notes |
|---|---|---|
Driver-script comment-address rewriting |
|
|
What this means for the siblings
Each sibling can now:
Add
fantasmas a dependency in itspyproject.toml.Run
fantasm project init --name <project> --prefix <prefix>...at the repo root to generate itsfantasm.toml.Optionally populate
[memory] regions / external_regions,[[versions.entry]]entries (withparentsandreloc_blocks), and per-project label hints in[comments.suggest.label_hints].Delete
src/disasm_tools/.Update the
[project.scripts]console-script entry fromacorn-{x}-disasm-toolto either drop it (users invokefantasmdirectly) or keep a thin shim for muscle memory.Drop project-specific tools/ scripts whose capability is now in fantasm (the ~7 fantasm-covered scripts from the survey above).
The eleven generate_*.py driver-translation scripts in NFS, the
ADFS ld65/Hoglet/JGH ingestion scripts, the resolve_unmapped_*.py
investigators, and project-specific README generators stay in their
repos — these are version-specific orchestration that doesn’t
generalise.