refactor(dynseal): one copy of the subsystem, not two and a half #10
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/consolidate-dynseal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stage 1 of reviving dynseal. Consolidation only — no behaviour change, and
nothing touches the database.
Why
dynseal was in three places:
dynseal/docs/dynseal/docs/dynseal_server.py…and
docs/also carried byte-identical copies of both shell scripts.The divergent file is the point.
dynseal/'s publisher calls_assert_dynseal_schema;docs/dynseal/'s still calls_init_dynseal_tables.That is the schema-first move — DDL belongs in migrations, service code asserts
presence — caught half-done, with the old version preserved beside the new one
and nothing to say which was which. The copy dropped here is the older one.
What this unblocks, measured
Two files named
test_security_scenarios.pyin directories with no__init__.pyare a pytest import collision. Before:After: collection completes cleanly. It still finds zero tests, because the
class is
SecurityScenarioTesterrather thanTest*— a separate fix, later inthis series — but the collector no longer aborts, which is what stopped the
whole directory from being reachable at all.
A pre-existing bug, written down rather than fixed
start-dynseal-server.shinitialises./data/foundation.dbrelative to the reporoot, while the server opens
<its own directory>/data/foundation.db. Thosehave never been the same file, so that block has never initialised the database
the server uses.
Moving the server changes which wrong path it is, not whether it is wrong. It
is left alone and commented: the schema-first conversion removes both sides, and
aligning a SQLite path on its way out is work with a shelf life.
Testing
pytest --collect-only dynseal/— aborts before, clean after (above).tools/check_schema_registry.py— still reports the registry consistent.bash -n start-dynseal-server.sh— clean.R100renames, so history follows them.PATTERNS_DIRandDB_PATHderive from its own location and areboth
mkdir'd at startup; neither previously existed on disk, so the movebreaks nothing.
Impact Statement
Breaking changes: none. No module's contents change. Five files move, one
superseded copy and two duplicated scripts are removed, and one path reference
plus the README are updated.
Risk. The only external-facing change is that
start-dynseal-server.shnowruns
dynseal/dynseal_server.py. Anyone invokingpython3 dynseal_server.pyfrom
docs/by hand will need the new path; the README is updated to match.What this does not do: revive anything. dynseal still cannot run — its
forge_rootis hardcoded to a directory that no longer exists, and it asserts aSQLite schema while naming a Postgres migration. Those are the next stages.