Repository navigation
#109 feat: name pre-ship's import targets in .skills/import-targets - #123
Merged
Merged
Conversation
pre-ship.sh guessed `co_status` from the [project] name, found no such package and skipped its import check on every run. The knob names every module a unit's launcher hands to Python: src.api.main, src.core.db_safety, src.core.schema_state, scripts.sweep_monitors, scripts.check_drift. tests/ci/test_import_targets.py holds the file, pins its set to what deploy/*.service's launchers run, and imports each target in a fresh interpreter with a scrubbed environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #109
What
.skills/import-targets, the knobshipping-work'spre-ship.shreads for its import check. Until now pre-ship guessedco_statusfrom the[project]name, found no such package and skipped the check on every run.The target set, and why
Every module a unit's launcher hands to Python, and nothing else:
src.api.mainserve.sh,dev_server.sh(uvicorn src.api.main:app)src.core.db_safetydev_server.sh,sweep.sh(python -m)src.core.schema_statedev_server.sh(python -m)scripts.sweep_monitorssweep.sh(python scripts/sweep_monitors.py)scripts.check_driftdrift.sh(python scripts/check_drift.py)The brief suggested
src.api.main,src.core.sweep,src.core.drift. Measured in a bare environment, both sets import the samesrcmodules (everything butsrc.core.importerandsrc.core.tenants, which no unit runs). The difference is the scripts' own imports. Break one namecheck_drift.pyimports fromsrc.core.driftandimport src.core.driftstill passes, but the drift unit dies on start. With the scripts as targets, the test fails on that edit (mutation 1 below).db_safetyandschema_stateare already insidesrc.api.main's closure. They're listed anyway so the rule stays mechanical: the test can derive the whole set from the launchers.Test:
tests/ci/test_import_targets.pydetect-import-targets.sh's grammar;Exec*=line indeploy/*.service(arguments allowed), eachscripts/*.shone starts, and each script those name in turn (tailnet_bind.sh), read foruvicorn M:app,python[3[.x]] -m Mandpython scripts/X.py, every occurrence on a line. Any other non-commentpython/uvicornline fails the test, so a new invocation form can't slip past the parser. A mismatch names what to add and drop;env={"PATH": "/usr/bin:/bin"}, i.e. noDATABASE_URLorTEST_DATABASE_URL.Red first: 3 failed with no file, then 3 passed. Mutations, each restored afterwards:
check_drift.pyimports a namesrc.core.driftlacksdrift.shgainspython -m src.core.importersrc/core/build.pyreadsDATABASE_URLat importReview (CR, applied)
Six findings, all in the pin's parser, one commit each: every
Exec*=line read, arguments too (1);python3/python3.12(2); every invocation on a line (3); helpers a launcher runs (4); all four launchers held (5); a mismatch says what to change (6). Each has a synthetic-input test that failed first, except 5 and 6, which were checked by breaking a unit file and the knob on purpose.pre-ship.shfrom the worktree (rc 0)pre-ship prints its
=== Import check ===header only when it skips. When it runs, each target gets its own section, and a section with nothing under it passed:No "Skipping" anywhere in the log.
Deploy
None needed:
drift.counts()ignores.skills/andtests/.🤖 Generated with Claude Code