Skip to content

chore(memory): unknown flags must fail loudly, not fall through - #490

Merged
sandstream merged 1 commit into
mainfrom
chore/shared-mem-flag-strictness
Aug 20, 2026
Merged

sandstream merged 1 commit into
mainfrom
chore/shared-mem-flag-strictness

Conversation

@sandstream

Copy link
Copy Markdown
Owner

What

One-line append to the curated shared tier (.kit/shared/memory.jsonl) — entry 716c68, area cli, kind convention.

Why

The #487 arc found that hasFlag matches exact tokens, so a near-miss flag is simply not seen and the command silently takes a different branch: kit upgrade --self. (trailing period) skipped the self-upgrade path and rewrote every installedAt in the lock file instead. The code fix landed in #487; the rule behind it is invisible in git, so it goes to the tier teammates and fresh sessions actually read.

The entry records the rule plus two corollaries already enforced in code:

  • command flag allowlists must include GLOBAL_FLAGS (--read-only / --readonly / --non-interactive / --env / --help / --version), or a documented global reads as unknown;
  • leading globals are stripped before positional dispatch — command modules read subcommands off raw argv indices.

Verification

  • kit memory verify → 32 entries, 32 trusted, 0 bad-sig, 0 untrusted, 0 unsigned
  • append-only: no existing entry edited or removed (diff is 1 insertion(+))
  • documented placements re-exercised against merged main: kit --read-only check, --readonly, --non-interactive, --env=prod check, check --read-only, --read-only check --category security, --read-only check verify-attestation — all dispatch correctly; kit upgrade --self. exits 1 listing accepted flags and writes nothing
  • node --test on the flag suites: 44 pass, 0 fail

🤖 Generated with Claude Code

Promotes the #487 arc decision to the curated shared tier: hasFlag matches
exact tokens, so a near-miss flag is invisible and the command silently
takes another branch (`kit upgrade --self.` rewrote lock-file timestamps
instead of self-upgrading). The entry records the rule plus the two
corollaries — command allowlists include GLOBAL_FLAGS, and leading globals
are stripped before positional dispatch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit a55b24e into main Aug 20, 2026
19 checks passed
@sandstream
sandstream deleted the chore/shared-mem-flag-strictness branch August 20, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant