Commit Graph
273 Commits
Author SHA1 Message Date
bchanot 8e93507b19 fix(router): only Haiku 4.x takes no effort; Haiku 5.x gets its route's
The no-effort rule was keyed on every claude-haiku id, so Haiku 5.5 ran at the engine default instead of its phase effort (mechanical: low). The guard now names Haiku 4.x; status-reporter pins effort: low.
2026-10-25 22:19:55 +01:00
bchanot 2202964d02 feat(router): the /model picker asks its scope; a hand pick always switches
A pick in the picker is held (PreModelSwitch deny), then the same project / conversation / everywhere question runs; only Everywhere reaches the native write to user settings.json. A model chosen in that dialog bypasses the cold-read caps but waits while held down.
2026-10-25 20:36:49 +01:00
bchanot 1fde5bbc76 feat(router): /model <name> asks its scope: project, conversation, everywhere
This project writes model into .claude/settings.local.json and sets a sticky route; This conversation sets the sticky route only; Everywhere runs the native write. Links refused in the project tree, native never runs after an answer.
2026-10-25 16:21:39 +01:00
bchanot 34c6534620 Merge feature/router-keyword-cap into develop 2026-10-23 17:40:14 +02:00
bchanot 5c6e368937 test(gitflow): start outside a git repo exits non-zero 2026-10-23 17:09:56 +02:00
bchanot 70e0f9ac41 feat(lib): code-origin.sh tells our code from foreign code 2026-10-23 16:54:15 +02:00
bchanot 786ee13c24 feat(router): keyword rules, ultrathink and dispatches set effort only
Prompt rules and the derived orchestrate route write effort-only routes, so
they never lift main above the session model; a held run keeps its model.
Fable on main comes from skill rows, the route tool or /route (BDR-123).
2026-10-23 01:24:16 +02:00
bchanot 801992a2ce fix(tests): mods suite gates validate on the --strict exit code
CLI 2.1.306 prints an advisory plugin-directory section (ICON_MISSING,
blocking: false) that the whole-output `warning` grep counted as a
failure. The verdict is now the rc of `claude plugin validate --strict`
(per-file warnings → 1, directory advisory never), through one helper
shared with a positive control on two scratch manifests.
2026-10-22 21:07:25 +02:00
bchanot ef13713f09 feat(doctrine): main on Fable writes no code past the /hotfix scope
The Sub-agents rule gains the ceiling and hands the rest to /feat or /bugfix; README and the challenge citers now say the main loop reaches Fable through best-tier rows from an opus session. /deploy's floor follows its verify row and its stale changed entry goes.
2026-10-21 22:18:16 +02:00
bchanot b961ce6b98 Merge feature/routing-audit-phase into develop
# Conflicts:
#	.claude/memory/journal.md
#	.claude/memory/learnings.md
#	.claude/tasks/TODO.md
2026-10-21 17:45:01 +02:00
bchanot a7d747c65f feat(model-router): audit phase puts the verifier and security-auditor on Fable
New best-tier phase audit (xhigh) carries both merge gates; their opus frontmatter stays the outage floor, since inTier never writes below a tier head. The census floors best-tier rows on the second alias, and the citers now name the audit row.
2026-10-21 16:50:47 +02:00
bchanot 5a98c2c095 fix(guardrails): probe fails closed on budget, redirects and unread bodies; rules lose five false positives and gain seven misses
The probe trusted the plan's Supabase url, followed redirects for free,
crashed on deep JSON and stopped at the first unconfirmed map candidate.
Rules now scope hydrated state to the export chunk, silence dev configs,
UI-suffixed data attributes, GraphQL types and metadata keys, and catch
Go raw strings, triple-quoted f-strings, sql.raw, empty select() and
multi-line hidden inputs; text output is sanitised; per-variant locks.
2026-10-21 00:13:32 +02:00
bchanot 63a88bc91d fix(guardrails): CONCAT before RAW, probe row newline kept, malformed urls handled, sa.text matched 2026-10-19 12:17:56 +02:00
bchanot 9275e0d82b fix(guardrails): Ruby where interpolation stays FAIL under CONCAT, PHP shell variables always count 2026-10-19 11:59:40 +02:00
bchanot c0fdbec3c1 fix(guardrails): probe map and fields verdicts fail closed, console rule sees public/, raw escape WARN, argv silent, plan validation 2026-10-19 11:56:25 +02:00
bchanot 6c0006bce3 fix(guardrails,a11y): CLOSED fields probe assertion, drop floor suppressions 2026-10-19 10:52:27 +02:00
bchanot 5643e9dbd4 fix(guardrails): bound DATA_ATTR, SCRIPT_SRC, TRACE_MARKERS and the comment blankers, SENSITIVE_KEY aligned with the spec, 5xx map SKIPPED, base64 inline maps only, RecursionError and supabase shape guarded, large .map head read 2026-10-19 01:19:40 +02:00
bchanot 60d447e544 feat(a11y): skill (scan, keyboard walk, report, fix loop on the bugfix circuit), lazy rules/a11y.md, profiles, locks 2026-10-19 00:48:09 +02:00
bchanot 811077da2b fix(guardrails): probe reads inline maps anywhere in the body, SKIPPED on an oversize map, validation never raises, bounded trace marker, .map guess from the path 2026-10-19 00:45:25 +02:00
bchanot 8b6472b8c4 feat(guardrails): exposure probe (source maps served or inline, error bodies, sensitive keys) that fails closed; every plan path validated; fetch keeps error bodies 2026-10-19 00:42:13 +02:00
bchanot 6e79d182e3 feat(a11y): standalone scanner on the shared engine (A11Y-CLEAR / A11Y-NO-NEW); guardrails drops the a11y domain 2026-10-19 00:40:26 +02:00
bchanot b4ef6ae359 fix(guardrails): bounded comment/env patterns, multi-line errorhandler guard, WIDE mutants 2026-10-19 00:38:21 +02:00
bchanot d46201c561 feat(guardrails): exposure domain (EXP-*): console data, source maps (config, public dir, large files), hydrated state, shipped comments, data attributes, error bodies in routes, debug mode, wide responses 2026-10-19 00:34:57 +02:00
bchanot 7500a618fe feat(guardrails): injection domain (INJ-*): per-language SQL concat and raw escapes, dynamic EXECUTE, PostgREST, NoSQL, shell into DB tools; shared code_files/hits/dedupe helpers 2026-10-19 00:32:06 +02:00
bchanot 73c25d759e feat(guardrails): propose, apply accepted fixes, re-pass to prove them
After the report the skill proposes fixes (plan phase), stops for the
user's acceptance, applies accepted ones via bugfixer and the
verify-secure gates, then re-scans. scan.py gains --assert-absent
(contract oracle, positive control) and --baseline (no new hit).
2026-10-18 19:04:13 +02:00
bchanot f0bcbfef46 feat(guardrails): read-only live probe to confirm a hole from outside
probe.py observes a running target the user owns and names, driven by a
plan built from the static findings. Five probes: anon-read, cross-user,
no-auth route, CORS reflection, capped rate-limit burst. GET/HEAD/OPTIONS
only, --authorized gate, secrets from the environment, same-host redirect
only, bounded request budget. SKILL STEP 5, checks.md reference, docs.
Suite guardrails-probe.test.sh (16 checks) against a localhost fixture.
2026-10-18 18:49:51 +02:00
bchanot 558c49e1a1 feat(guardrails): secure-by-default rule and /guardrails scanner
Always-on rules/secure-by-default.md: hosting, a11y, Supabase RLS,
SMS/email consent, cloud functions, API hygiene incl. password storage.
Stdlib scanner (FAIL/WARN/MANUAL) + skill, 89-check suite, auditor
gate wiring, profiles, routing row (plus Explore rows confirmed
through the router dialog).
2026-10-18 18:10:20 +02:00
bchanot faedb98699 fix(explain-diff): arrow class no longer collides with edge callout; bundle fill_template.py
Eval iteration 1: the callout 'edge' variant picked up the diagram connector styles, and all three skill runs hand-wrote a template filler. fill_template.py takes values.json with @fragment files, escapes </ in the quiz; suite 21 checks.
2026-10-17 13:10:37 +02:00
bchanot b353fac2ba feat(explain-diff): explain a diff as one self-contained HTML page
Adapted from Geoffrey Litt's explain-diff gist: background, intuition, grouped code walkthrough, 5-question quiz, saved outside the repo. Bundled template, components catalog and checker with its test suite. Row reflect; profiles full, max, dev.
2026-10-17 13:05:01 +02:00
bchanot f08efa3b9a chore(design): impeccable is the Build path, gate blocks on it instead of frontend-design
GATE-BLOCK swaps frontend-design for impeccable; Build line, gate prose, advisor rows follow. Detector rule count 45 to 61. BDR-119.
2026-10-16 18:19:29 +02:00
bchanot e91dcb3f12 feat(commits): follow project convention, else short messages
New lib/commit-message.md looks for a documented convention first. Without one, messages stay under 50 words at medium technical level.
2026-10-16 11:49:26 +02:00
bchanot 2ce203a2da feat(model-router): cold-read cap on main-loop downgrades, switch on by default, classifier may route down
The main loop may now move down to a cheaper model by default
(mainModelSwitch true, fail-closed picker). Both caps measure the COLD
READ a switch costs: the context minus what the target model's prompt
cache already holds, from a per-model served record written on every
main step (1 h TTL, cleared by /clear and /route reload; a smaller
context than the record counts as cold). downgradeMaxTokens defaults to
120000, upgradeMaxTokens keeps 200000; no return bypass is needed since
a warm return is cheap by construction.

The prompt classifier writes the full phase route: coding and
bookkeeping guesses move main down under the switch and the cap; a guess
never ranks above the session model; a mid-turn ultrathink floor keeps
its model; a user /effort typed between turns drops the guess for that
turn only (engine baseline is now per turn). A model-loaded helper skill
inside a best-tier run moves effort only. Main routed onto a model whose
window the context outgrew returns to the session model. The skip line
is said once per cap crossing; the toast names a cap hold; the status
line shows the switch only when off.
2026-10-13 01:13:06 +02:00
bchanot 84446612ae refactor(toggle-external,profile): one tool roster, split arms, shared gstack helpers
code-clean B5 (enable_tool split into enable_gstack/
enable_external_single/enable_pack), B7 (enable_skill into
enable_gstack_skill/enable_linked_skill/enable_plugin_skill), B9
(cmd_show into _show_entries/_show_plain/_show_grouped, `_show_plain`
ends with an explicit return 0), B18 (locals), B19 (comment).

/refactor C4: tool_kind/tool_source replace the 3 hand-copied name
lists with the MANAGED_TOOLS roster (exact-match loop), and disable_* is
split to mirror enable_*.

/refactor C5: gstack_skills/gstack_parked_names/gstack_park/
gstack_unpark move into lib/gstack-removed.sh, the only sourced file the
fixture suites copy, and profile.sh and toggle-external.sh both use
them.

496-run golden capture identical; make test 47 green, shellcheck 0.
2026-10-12 22:51:41 +02:00
bchanot 4c966ebdfc fix(toggle-external): --help prints the whole header, all 14 tools
usage() printed lines 3-26 with a hardcoded range, but the tool list
runs to line 32, so 8 of the 14 tools were missing. It now reads
`sed -n '3,/^# ====/p' | sed '$d'` and stops at the closing banner, with
no line numbers. Logged in .claude/audits/BUGS-FOUND.md.
2026-10-12 22:51:37 +02:00
bchanot 381ed9fa5d chore(code-clean): lint directives, guarded cd, hook regex split, helper extractions
A1 drop unused `import gzip`; B1/B2 file-level shellcheck directives
placed before `set -u`; B3 `cd "$REPO" || exit 1`; B4 hook regex split
into `pattern+=` lines (sha256 of $pattern unchanged); B11
`_build_parser`/`_dispatch` pulled out of google_seo `_cli`; B20
detect-plugins header names update-all.sh; C2 prune-memory deterministic
suite wired into SUITES (literal path); C3 `_refuse_outside_allowlist`
moved up in deploy-commit.

No behavior change except B3 (a failed cd now exits 1) and C2 (one more
suite). B5/B7/B9/B18/B19 land in the refactor commit.
2026-10-12 22:51:28 +02:00
bchanot d08929d0e8 Merge bugfix/model-router-residuals into develop
# Conflicts:
#	.claude/tasks/TODO.md
2026-10-11 23:42:47 +02:00
bchanot a3fbb9ae3f fix(model-router): close the accepted residuals of waves 1-4
Kill switch fails closed: a present-but-unreadable override at first load
or a non-boolean enabled turns the router off (logged); /route reload says
when the previous config was kept. Prompt rules with nested quantifiers
are dropped; a config path that is not a regular file reads as failed;
caught errors log kind + code only (errWord); rejected keys are masked in
logs (keyWord), alias keys match KEY_NAME, prototype names are never keys;
offers capped at 256; a models alias without a fallback list is ranked at
the end of the default chain; canonical matches a table id at a '-'
boundary only; logCall/noteMain cannot unroute a step; route-tool failure
text no longer claims nothing was routed.

Repo side: mods suite probes the 'claude plugin test' usage line, doctor
bounds plugin list to 60 s, update-all skips @skills-dir mods.
Kit 431/431, full make test green.
2026-10-11 23:39:01 +02:00
bchanot fe7d5cdb28 fix(push-guard): argv check — a push must be git's own subcommand
The text regex becomes a prefilter. The command is split into simple
commands by an awk tokenizer (quotes, escapes, ; && || | ( ) backticks,
heredoc bodies dropped) and a push is only a simple command whose argv[0]
is git (or */git) with push or send-pack as its first non-option word.
grep "git push", git log -S, git config --get push.default, git stash
push, heredocs and commit messages quoting a push are no longer denied.
bash|sh|zsh -c scripts are re-checked (depth 3); wrappers (sudo, env,
eval, xargs, timeout, git subtree...), assignments whose value reads as
a push, a missing awk or > 2000 simple commands keep the text verdict.
Prefilter also matches "git" push (quote characters stripped).
Suite 98 -> 124 checks.
2026-10-11 23:24:39 +02:00
bchanot e54a2b5d61 feat(model-router): wave 4-B — prompt classifier
Plain composer prompts with no route in force get a turn-scoped effort
from $.model.classify (design/analysis/coding/bookkeeping/chat → phase
effort, effort only, never the model). Bounded by a 3 s clock race, a
user interrupt neither counts nor writes, three failures in a row pause
it for cooldownMinutes (one toast, status marker, cleared by /route
reload). No dialog, no routing.json write on a classified route. New
Config key `classify` (default on, pickSwitch), `/route classify on|off`
session toggle, `/route show` line and argumentHint. An explicit user
/effort beats the guess (engineBase check).

Docs: README classifier paragraph, USAGE row + sentence, CHANGELOG,
effort-shift.md. Kit suite 428 tests.
2026-10-11 21:05:29 +02:00
bchanot cd8d72f01f feat(model-router): wave 3-C — /route forget <name|all|projects>
Clears first-use decisions from the tracked routing.json through the
existing writer: a name is forgotten in every table (confirmed, changed
with the row restored to its recorded shipped phase under guards, project
exceptions pruned) and asked again; all and projects ask a confirmation in
the engine dialog (Cancel first) and hold the single-dialog slot; nothing
is written when there is nothing to forget; the answer names what was
restored and the frontmatter floor to realign when one was aligned; the
route tool has no forget path. Docs name the new writer. Kit suite 232 → 284.

Contract .claude/tasks/contracts/2026-10-11-model-router-w3c-forget-1457.md,
plan r3: 3 lenses + 1 confirmation, feater + 3 rounds (one real defect),
GATE 0 MET, verifier at the cap on coverage (user-accepted), security PASS.
2026-10-11 16:14:59 +02:00
bchanot 938c3d1a67 chore(agents): security-auditor floor aligned to its judge row (model: opus); model-routing lock updated 2026-10-11 14:25:45 +02:00
bchanot 604a6c4411 feat(model-router): wave 3-B — first-use dialog with context, model then effort on change
The dialog now explains what it asks about: the skill's description (from
its SKILL.md frontmatter, five YAML forms, first sentence, cleaned), the
agent's description (from agent.offer), the phase's new 'about' line in
routing.json, and the real model id and effort the next step runs on.
Options Later / Keep / Change; Change asks the model (fable, opus, sonnet,
haiku with their tier role), then the effort among those the phases of
that model offer, then the scope; the pair maps to an existing phase (rows
stay phase names; the row's current phase wins a tie; same phase = Keep).
A main-loop phase (T3) is Later / Keep only. A main-row change toasts the
real decision and the /route switch hint when the pick is a downgrade.
Descriptions pass a hardened read (name allowlist, stat kind, size cap)
and clean(). Kit suite 190 → 232; W3-A dialog tests migrated.

Contract .claude/tasks/contracts/2026-10-11-model-router-w3b-dialog-1240.md,
plan r3: 3 lenses (2 BLOCKERs: inline rows, phase edits) + 1 confirmation,
feater + 2 rounds, GATE 0 MET, verifier CONFORME (3rd pass), security PASS.
2026-10-11 14:10:24 +02:00
bchanot 22455c051f feat(model-router): wave 3-A — first-use route confirmation, decision memory, project exceptions
routing.json (tracked, reached through the plugin directory) is now the
single source of the phase table and of every skill/agent row, plus the
decisions: confirmed rows/phases, changed rows (from/to) and projects
exceptions keyed by a normalized git remote (credentials never stored, no
machine paths). First use of a rowed typed skill, a rowed agent spawn or a
main-loop phase opens the engine's dialog (Later / Keep / two alternative
phases; Other = a phase name); a change asks Everywhere or This project
only. One dialog at a time, never in headless, never inside an agent,
never written by the model: only a dialog answer or /route ask writes,
serialized, size-capped, never creating the file. Layers: routing.json <
~/.claude/model-router.json; the project tree is never read. /route
pending, /route ask on|off. Census reads rows and phases from the file and
tolerates a user-changed row (WARN). Kit suite 86 → 190 tests.

Contract .claude/tasks/contracts/2026-10-10-model-router-w3a-confirm-1201.md,
plan r4: 3 lenses + 1 confirmation, feater + 4 rounds, GATE 0 MET,
verifier CONFORME then re-verify after security, security BLOCK(1) fixed
then PASS. Live: T2 dialogs answered by the user from the hot-loaded mod.
2026-10-11 11:48:25 +02:00
bchanot 1f2d33b7a6 feat(model-router): wave 2-B — orchestrators declare phases, shifters and pins removed, frontmatter = off-state floor
The 15 Skill(effort-*) citers now call mcp__model-router__route per phase
(orchestrate at a dispatch span, reflect/plan for the skill's own level,
apply at the bookkeeping tail, escalate at the verify-secure caps); built-in
judgment dispatches carry an explicit effort= param. lib/effort-shift.md is
the route doctrine, lib/model-gate.md the mod rule (route answer = witness,
/route on as remedy). Deleted: skills/effort-*, lib/effort-pins.txt/.sh,
lib/model-check.sh, their tests, the installers' re-apply blocks. The mod
drops its Skill(effort-*) bridge. The tracked model:/effort: frontmatter
stays as the off-state floor, census-locked equal to the rows
(lib/tests/effort-routing.test.sh rewritten, 140 checks; analyzer → xhigh).

Contract .claude/tasks/contracts/2026-10-10-model-router-w2b-1045.md, plan
r4 § W2-B: GATE 0 MET, verifier ECARTS(7) then CONFORME 10/10, security
PASS, full make test green (design-tool-gate env red only).
2026-10-10 11:24:54 +02:00
bchanot 6430ac65ec feat(mods): model-router active in every session — skills-dir link, mods suite, doctor section, CLAUDE.md
Tracked relative symlink skills/model-router -> ../mods/model-router: Claude
Code loads the mod in place as model-router@skills-dir wherever link.sh
links ~/.claude/skills (no CLAUDE_CODE_PLUGIN_DIRS: absolute paths in the
tracked settings.json). Engine-laid mods/*/tsconfig.json gitignored.
lib/tests/mods.test.sh: manifest name, link target, claude plugin validate
and test per mod, capability-probed, time-bounded, SKIP with reason.
doctor.sh: fail-soft Mods section (link by -ef, one guarded plugin list).
CLAUDE.md: mods/ section (loading, per-machine enabled:false switch,
dev-copy shadowing, tests).
2026-10-09 10:51:13 +02:00
bchanot 3c59333fcf fix(push-guard): single reader, whole-word dir tokens, payload fallback, bad-value banner
Run D2 of manual-push mode (BDR-114).

- push-guard sources lib/gitflow.sh once (absolute path) and reads each
  candidate dir through gitflow_push_mode; a missing lib denies.
- Dir tokens are extracted as whole shell words: a fully quoted token
  (inner apostrophe allowed) is resolved, a backslash-escaped space is
  unescaped deterministically, a token mixing quoted and unquoted parts
  is refused (fail closed) instead of resolving to its parent.
- A payload jq cannot parse is scanned as raw text with its JSON escapes
  folded; a push-looking one gets the static deny through the trap.
- The 20-token cap runs before any per-token classification (a flood of
  20 000 tokens is refused in 0.13 s; T58 locks it under 5 s).
- `case "$mode"` has a deny default; missing core tools warn and allow.
- T42 compares the deny list against main (the last release) instead of
  HEAD; literal-true, mixed-token, broken-payload, lib-missing and
  banner-on-bad-value cases added (98 checks).
- session-start banner reads the mode through the verb and shows
  `push : manual (autopush bad)` on an unparseable value.
- tour hints quote "<abs project>".
2026-10-07 17:11:56 +02:00
bchanot 472cccbc52 fix(gitflow): every autopush reader fails closed and names an invalid value
Run D1 of manual-push mode (BDR-114). `git config --bool --default true
gitflow.autopush` only covered a MISSING key: an unparseable value made
git die with empty output, the `= false` test failed, and every push ran
again. A typo on a work machine silently re-enabled the pushes it was
meant to stop.

- lib/gitflow.sh: `_gitflow_push_off` reads the mode through the lib
  verb (`push-mode`); anything but `auto` is push-off, and the verb's
  stderr line names an invalid value during start/finish.
- Emitted post-commit/post-merge hooks (POSIX sh, standalone): push only
  when the key reads `true` or is unset; `false` exits quietly; any
  other result prints one stderr line ("NOT pushed, treated as manual
  push mode") and exits 0. Mirrors gitflow_push_mode.
- .githooks/ and githooks/ regenerated files-only through `emit-hook`
  (no config read or write; .git/config hash unchanged).
- hooks/unpushed-guard.sh: mode from the lib verb (absolute lib path
  resolved before any cd, no temp file); anything but auto is manual;
  the SessionStart line names an invalid or unreadable value.
- Tests: gitflow-test T18q block (invalid → start, hook and finish push
  nothing and say so; `true` → the hook pushes; emitted hook is
  POSIX-clean), unpushed-guard T14 rewritten.
2026-10-07 16:45:31 +02:00
bchanot 3881f462c6 fix(gitflow): run C polish — 5C coherence, sanitized verb stderr, hermetic suite
Closes the non-gap observations the gates left on runs C1/C2:

- capitalize STEP 5C/6: heading no longer says "+ push"; the --no-push
  fact read is its own paragraph and scoped to that path; the
  auto-persisted line requires finish rc 0 AND ahead = 0; rc 5/2/6
  (merged, branch not deleted) still report the push state; the
  "not on origin" line carries the once-a-remote-exists hint.
- gitflow.sh push-mode: the raw config value echoed on stderr is reduced
  to printable characters (LC_ALL=C, BSD tr safe) and capped at 64.
- gitflow-test.sh exports the hermetic git config env in the file, so a
  bare run on a global-manual machine stays green.
- client-handover-writer: the branch allowlist refuses a leading dash.
2026-10-07 14:35:08 +02:00
bchanot 5cf049d235 feat(gitflow): push-mode verb; /close reports the push state instead of pushing
Run C1 of manual-push mode (BDR-111/BDR-112).

- lib/gitflow.sh: `gitflow.sh push-mode` prints auto | manual | invalid
  (rc 0; an invalid value is named on stderr). It is the one reader a
  skill may call: the bare `git config … gitflow.*` read is denied to
  Claude since run B. Ignores GITFLOW_NO_PUSH by design (documented).
- skills/capitalize/SKILL.md STEP 5C: the explicit `git push origin
  develop` is gone — `finish` has pushed develop itself since BDR-095,
  mode-aware since run A. 5C is now three separate read-only calls
  (finish; push-mode; `git rev-list --count origin/develop..develop`)
  and prose outcomes keyed on the real ahead count: pushed / manual push
  mode, you push / not on origin / push FAILED / invalid value named,
  plus a finish-failure outcome (merge vs delete rc distinguished).
  STEP 6 closing lines and the recap carry every outcome; the
  `--no-push` line reads the branch's own ahead count ("this disk only"
  only when true). Invariant: no `git push` inside any Bash call; the
  user hints are prose.
- skills/close/SKILL.md, lib/gitflow-aiguillage.md: "push" claims
  qualified "in auto-push mode".
- lib/gitflow-test.sh T11b: six cases for the verb (default, true,
  false, non-boolean with stderr + rc 0, corrupt config, usage).

Polish items from the gates are listed in TODO.md (C1 polish).
2026-10-07 13:39:01 +02:00
bchanot 6468eda495 fix(push-guard): fail closed on token floods, git failures and quoted cd targets
Hardening after the security gate on a2ac018 (3 MEDIUM, all closed and
re-measured):

- dir tokens are deduplicated and capped: more than 20 distinct cd/-C
  targets in one command denies before any git fork (20000 tokens: 0.15 s
  against the 10 s hook timeout that used to turn a flood into an allow)
- a git or cd failure while reading gitflow.autopush denies instead of
  reading as auto (git absent, usage error, unenterable dir); the key
  being unset is the only "auto" answer; the decision is recorded only
  after one candidate was evaluated cleanly, else the EXIT trap denies
- cd/pushd/-C targets that follow a quote or backtick (bash -c '…') are
  extracted; quote characters are excluded from unquoted tokens

User decision (contract, gated): both fail-closed cases also fire in
auto mode on such pathological commands; silence in auto mode holds for
every ordinary push. Header limits list the residual misses (quotes or
backslashes inside a token, cumulative relative cd, unparseable payload)
backed by the soft_deny rule. Tests: 71 checks (T48–T50b added).
2026-10-07 12:34:56 +02:00