fix(compress): dotted caller convention — unbreak shorthand + verify-expand#80
Merged
Merged
Conversation
… model calls
The shorthand and verify-expand paths constructed SwarphCall with hyphenated
caller tags ('swarph-compress' / 'swarph-compress-verify'). A caller-convention
validator added to swarph_shared after #64 requires dotted role.subrole form
(^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$), so both model-driven paths crashed at
runtime with ValueError — archival (no model call) was unaffected, masking it.
Extract the tags to module constants SHORTHAND_CALLER='swarph.compress' and
VERIFY_EXPAND_CALLER='swarph.compress.verify', and add a regression test that
validates them directly. The existing levers/verify tests inject a fake chat and
never construct a real SwarphCall, which is why the break shipped silently.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 20, 2026
darw007d
pushed a commit
that referenced
this pull request
Jun 20, 2026
…oplet review) Folds in droplet's two non-blocking polish items pre-merge: 1. COMMIT the catch-property (don't manually-verify-once) — test_guard_catches_a_planted_bad_caller plants a hyphenated *_CALLER on a discovered module + asserts the guard discovers AND rejects it. This is #80's own lesson applied to the meta-guard: pin it, don't remember it. 2. test_no_modules_skipped_by_the_walk asserts the introspection walk skips ZERO modules, so a bad caller in a module importable-in-prod-but-not-CI can't ship silently uncaught. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
darw007d
added a commit
that referenced
this pull request
Jun 20, 2026
* harden(caller): repo-wide validate_caller meta-guard (#81) Import-introspection over every `*_CALLER` constant in the swarph_cli package + validate_caller each, so the #80 hyphenated-caller bug class can't be re-introduced in ANY module without a per-caller test. Converged design (lab+droplet): introspect named constants, not AST literal-walk — `caller=SHORTHAND_CALLER` is an ast.Name, not a literal, so a literal-walk would miss exactly the callers #80 hardened. Negative-control verified (a planted hyphenated *_CALLER is discovered + caught). Test-only; no production change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * harden(caller): pin the negative-control + assert exhaustive walk (droplet review) Folds in droplet's two non-blocking polish items pre-merge: 1. COMMIT the catch-property (don't manually-verify-once) — test_guard_catches_a_planted_bad_caller plants a hyphenated *_CALLER on a discovered module + asserts the guard discovers AND rejects it. This is #80's own lesson applied to the meta-guard: pin it, don't remember it. 2. test_no_modules_skipped_by_the_walk asserts the introspection walk skips ZERO modules, so a bad caller in a module importable-in-prod-but-not-CI can't ship silently uncaught. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: lab-ovh <lab@brainsurfing.tech> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
darw007d
added a commit
that referenced
this pull request
Jun 20, 2026
…) (#84) The repl-default caller rolled its own slug that — unlike caller._sanitize_username which default_caller uses — didn't guarantee a leading letter / collapse underscores / fall back on empty. So a leading-digit OS username produced a non-conforming 'cli.repl.3bob' that crashes SwarphCall at runtime (the #80 crash-class on the dynamic path). Fix is DRY: reuse the one robust sanitizer, eliminating the divergence (USER=3bob -> cli.repl.u_3bob; !!! -> cli.repl.unknown). + a parametrized adversarial- username regression test (leading-digit/all-special/empty/etc). No production behavior change for normal usernames; 53 chat/caller tests green, #80+#82 unaffected. Co-authored-by: lab-ovh <lab@brainsurfing.tech> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
darw007d
added a commit
that referenced
this pull request
Jun 21, 2026
…, repl-caller #83/#84) Ships the dotted caller-convention fixes that were merged to main but unreleased: - #80: compress shorthand + verify-expand model paths were DEAD at runtime (hyphenated callers rejected by swarph_shared's dotted convention) — now dotted constants. - #82: repo-wide validate_caller meta-guard so the bug class can't be re-introduced. - #83/#84: _default_repl_caller convention-safe slug (reuses _sanitize_username). Anyone on 0.13.2 running `swarph compress` hit the dead path; this releases the fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
swarph compress --lever shorthand(and the adversarial verify-expand) have been dead at runtime since a caller-convention validator landed inswarph_sharedafter #64. Both constructedSwarphCallwith hyphenated caller tags (swarph-compress/swarph-compress-verify), which the validator rejects:The archival lever (no model call) was unaffected, which masked the break.
Fix
SHORTHAND_CALLER="swarph.compress",VERIFY_EXPAND_CALLER="swarph.compress.verify".SwarphCall(...)construction.tests/test_compress_caller_convention.pythat runsvalidate_caller()on the real tags — the existing levers/verify tests inject a fakechatand never build a realSwarphCall, which is exactly why this shipped silently.How found
Dry-run of
swarph compresson a live memory-index surface (commander-requested) crashed atSwarphCall(...); archival on a manual surface ran clean. Verified the fix at the exact crash point (SwarphCall now constructs with both dotted callers) + 20/20 compress tests green.Notes for review
compress/levers.py,compress/verify.py, and a new test — zero overlap withwatchdog.py.🤖 Generated with Claude Code