remove code related to dry run and dep graph rendering (ps1 meta)

This commit is contained in:
ed
2026-07-25 11:59:41 -04:00
parent ebb876fe89
commit 653e18ee28
10 changed files with 11 additions and 72 deletions
-37
View File
@@ -77,7 +77,6 @@ local PASS_FLAG_DISPATCH_KEY = "__pass__"
--- @field out_root string -- output root (e.g. "build/gen")
--- @field project_root string -- PS1 repository root
--- @field flags table -- CLI flags + per-pass stash
--- @field dry_run boolean -- if true, compute but don't write
--- @field verbose boolean -- if true, log diagnostic info
--- @class Finding
@@ -96,7 +95,6 @@ local PASS_FLAG_DISPATCH_KEY = "__pass__"
--- @field metadata string -- --metadata value
--- @field out_root string -- --out-root value (default "build/gen")
--- @field project_root string -- PS1 repository root (derived from metadata by default)
--- @field dry_run boolean -- if true, compute but don't write
--- @field verbose boolean -- if true, log diagnostic info
-- ════════════════════════════════════════════════════════════════════════════
@@ -299,7 +297,6 @@ COMMON_FLAGS:
<repo>/code/duffle/word_count.metadata.h)
--gdb-runtime Also emit <out_root>/gdb_tape_atoms_runtime.gdb (post-link, requires --elf)
--elf PATH Path to linked .elf (for --gdb-runtime / --dwarf-injection)
--dry-run Print dep order (alphabetical); exit 0 without running
--verbose Print per-pass debug output
--help Show this help and exit
@@ -345,7 +342,6 @@ FLAG_HANDLERS["--help"] = function(args)
os.exit(0)
end
FLAG_HANDLERS["--dry-run"] = function(args) args.dry_run = true end
FLAG_HANDLERS["--verbose"] = function(args) args.verbose = true end
FLAG_HANDLERS["--source"] = function(args, argv, arg_idx)
local value, value_idx = require_flag_value(argv, arg_idx, "--source")
@@ -430,7 +426,6 @@ local function parse_args(argv)
metadata = nil,
out_root = DEFAULT_OUT_ROOT,
project_root = nil,
dry_run = false,
verbose = false,
}
@@ -611,7 +606,6 @@ local function build_ctx(args)
out_root = args.out_root,
project_root = corpus.project_root,
flags = args.flags or {},
dry_run = args.dry_run,
verbose = args.verbose,
}
@@ -709,28 +703,6 @@ local function topo_sort(passes, requested_set)
return order
end
-- ════════════════════════════════════════════════════════════════════════════
-- ASCII dep graph renderer (Decision 6 in the spec)
-- ════════════════════════════════════════════════════════════════════════════
-- ════════════════════════════════════════════════════════════════════════════
-- Topological dep-order printer (used by --dry-run).
-- Re-render the PASSES graph manually in `docs/guide_metaprogram_ssdl.md` if you need an updated visual;
-- The canonical ASCII view there is regenerated by hand whenever PASSES rows change.
-- ════════════════════════════════════════════════════════════════════════════
local function render_dep_order(passes, closed)
local lines = {}
lines[#lines + 1] = "[ps1_meta] Resolved dependency order (closed under deps):"
for pass_idx, name in ipairs(closed) do
local p = passes[name]
local deps_str = (#p.deps == 0) and "(no deps)" or
"(deps: " .. table.concat(p.deps, ", ") .. ")"
lines[#lines + 1] = string.format(" %d. %-22s %-45s [%s]",
pass_idx, name, deps_str, p.kind)
end
return table.concat(lines, "\n") .. "\n"
end
-- ════════════════════════════════════════════════════════════════════════════
-- Main Orchestrator
-- ════════════════════════════════════════════════════════════════════════════
@@ -777,13 +749,6 @@ local function main(argv)
local requested = args.requested_set
local closed = topo_sort(PASSES, requested)
-- --dry-run: print the closed dep order and exit OK.
-- (The hand-rendered PASSES graph lives in docs/guide_metaprogram_ssdl.md; see Decision 6.)
if args.dry_run then
io.write(render_dep_order(PASSES, closed))
os.exit(EXIT_OK)
end
local had_errors = dispatch_passes(ctx, closed)
if had_errors then os.exit(EXIT_VALIDATION_ERRORS) end
end)
@@ -797,11 +762,9 @@ local function main(argv)
end
-- Module export for in-process consumers (tests that dofile this script).
-- The closed dep-order printer + the `PASSES` table are exposed so a test can observe the resolved dep order for synthetic PASSES tables without spawning a subprocess.
-- The conditional `main(...)` call below only fires when this file is invoked as the entry script (arg[0] ends in "ps1_meta.lua");
-- in dofile() mode (test's arg[0] does not match), main() is skipped and the chunk returns `_M` to the caller.
local _M = {
render_dep_order = render_dep_order,
PASSES = PASSES,
PASS_KIND_STOP_ON_ERROR = PASS_KIND_STOP_ON_ERROR,
parse_args = parse_args,