Commit Graph
1202 Commits
Author SHA1 Message Date
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 988038cce3 refactor(guardrails): extract the scan engine into scanner.py, scan.py keeps the catalogue 2026-10-19 00:30:03 +02:00
bchanot ed06e8cc1d docs(ship-feature): plan revision 3 and spec amendments after the confirmation pass (fail-closed sourcemap, quote-matched concat, scoped dev-env lock) 2026-10-19 00:19:18 +02:00
bchanot 6eba3248b0 docs(ship-feature): plan revision 2 after the three-lens challenge (per-language injection, fail-closed probe, scoped exposure rules) 2026-10-18 23:51:57 +02:00
bchanot fa20562cac docs(ship-feature): spec and plan for the a11y split, injection and exposure domains 2026-10-18 22:59:12 +02:00
bchanot bee377af1a Merge feature/secure-by-default into develop 2026-10-18 19:13:55 +02:00
bchanot abe2ca3b60 chore(memory): BDR-121 guardrails fix loop 2026-10-18 19:13:42 +02:00
bchanot 794e720658 chore(memory): guardrails fix loop, TODO T10-T14, journal 2026-10-18 19:04:14 +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 b17de15c22 chore(memory): guardrails live probe, TODO T9, journal 2026-10-18 18:49:51 +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 dbf409f6e6 chore(memory): BDR-120 guardrails, TODO T1-T8, journal 2026-10-18 18:10:21 +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 c5fad5ee8f Merge feature/explain-diff into develop 2026-10-17 18:24:27 +02:00
bchanot e21cd23bf5 chore(memory): explain-diff iteration 1 — TODO, journal 2026-10-17 13:12:55 +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 6f0deb489d Merge bugfix/router-probe-session-model into develop 2026-10-16 19:11:06 +02:00
bchanot 0da0617ea8 docs(model-router): probe covers the kept session model 2026-10-16 19:11:05 +02:00
bchanot b1287097fb chore(memory): BLK-031 router probe skipped kept session model 2026-10-16 19:10:46 +02:00
bchanot eb6a45b1a6 chore(memory): router probe session-model fix — contract, journal, TODO residual closed 2026-10-16 19:07:09 +02:00
bchanot c11cd3b53b fix(model-router): probe the kept session model, not only a move target
A session on Fable without credits kept Fable unprobed and lost its first turn, and each hold lapse, to the 429. The probe now covers the model the decision lands on, moved or kept.
2026-10-16 19:06:43 +02:00
bchanot a8eb3f2e90 Merge chore/router-confirmed-rows into develop 2026-10-16 18:36:54 +02:00
bchanot f8665b292b chore(model-router): routing.json — confirm 7 agent rows, reflect/plan/apply phases, gitflow + ship-feature skills 2026-10-16 18:36:36 +02:00
bchanot 28993c15e0 Merge chore/impeccable-build-path into develop 2026-10-16 18:20:05 +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 218fc86494 Merge feature/short-commit-messages into develop 2026-10-16 11:49:28 +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 eb1cfe55a9 Merge branch 'develop' of ssh://git.bchanot.fr:49222/bchanot/claude into develop 2026-10-15 00:12:57 +02:00
bchanot 84e3511b30 Merge bugfix/router-probe-before-route into develop 2026-10-15 00:12:23 +02:00
bchanot 304270fe5b chore(memory): BLK-030, LRN-218, TODO + journal, router-probe-before-route contract + plan 2026-10-15 00:12:18 +02:00
bchanot da0b4a65ba docs: model-router move-target probe, probe key, stand-in effort — bugfix router-probe-before-route 2026-10-15 00:12:10 +02:00
bchanot 2cccc43d37 fix(model-router): probe a move target before routing main to it
The breaker learned availability only from a failed request: with
Fable out of usage credits, every new session and every hold lapse
routed main to Fable and lost the turn to a 429
(model_requires_usage_credits, typed rate_limit).

decideFor now probes the model a decision moves main to, once per
session, with a 1-call $.model.complete raced against 8 s: a timeout
or rejection marks it down (reason "probe") and re-decides once. The
current model and held ids are never probed; `probe: false` in
~/.claude/model-router.json turns it off. When a model ranked below
its tier head stands in where the head would have run, the phase's
own effort goes one notch up (reflect xhigh, plan max on Opus).
2026-10-15 00:07:10 +02:00
bchanot dc6507dc86 Merge chore/self-explanatory-code into develop 2026-10-14 12:51:40 +02:00
bchanot 3065f08328 chore(rules): self-explanatory code, literal-scope guideline 2026-10-14 12:51:39 +02:00
bchanot fce24644b4 Merge feature/router-downgrade-cap into develop 2026-10-13 21:59:39 +02:00
bchanot aaeb125490 docs: model-router general-purpose pin, prompt estimate, engine cache TTL — feat router-cap-residuals 2026-10-13 21:37:52 +02:00
bchanot 2b91ce26bd chore(memory): BDR-116 amendment 2, LRN-217, TODO + journal, router-cap-residuals contract + plan 2026-10-13 21:37:30 +02:00
bchanot 1be57a382c feat(model-router): close the cap residuals: session pin for inheriting spawns, prompt-size estimate, engine cache TTL
A built-in general-purpose agent with no explicit model, spawned by main
while main sits below the session model, is sent the session model
instead of inheriting the demoted one (narrow: built-in source, no fork,
no workflow, main's own child; other types carry their own frontmatter
model the hook cannot see). The cold-read cap now counts the prompt the
engine's usage may not include yet: code points / 3 of the submitted
text, its context entries and main's typed skill body, summed, added at
the turn's first main step unless usage already grew by half of it;
a document attachment makes the size unknown (blocks). Texts and the
step read the same adjusted size; the served record stays raw. The
cache TTL follows the engine's cache_ttl ('5m' | '1h') from main's
PostModelSwitch events, survives /clear, and /route show prints it.
2026-10-13 19:56:17 +02:00
bchanot ab963e97dc chore(memory): BDR-116 amendment, LRN-216, EVAL-047, TODO + journal, router-downgrade-cap contract + plan 2026-10-13 09:42:47 +02:00
bchanot e8186409df docs: model-router cold-read caps, switch on by default, classifier routes down — feat router-downgrade-cap 2026-10-13 09:42:46 +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 f3b47287f9 Merge chore/rust-default into develop 2026-10-12 23:31:19 +02:00
bchanot 1287810d15 chore(memory): BDR-118 Rust default language 2026-10-12 23:31:18 +02:00
bchanot ee767239f2 chore(rules): Rust as default language for new projects and whole-project rewrites
rules/default-language.md loads always-on (CLAUDE.global.md at 317/320,
BDR-085 exception path). Interviewer proposes Rust when the language is
not stated; init-project captures the language choice as a founding BDR.
2026-10-12 23:03:02 +02:00
bchanot 95f87cf4e3 Merge chore/code-clean into develop 2026-10-12 22:56:20 +02:00
bchanot 8693fff1d8 chore(memory): code-clean run, LRN-213/214/215, EVAL-046, BDR-117, journal, TODO, plan + audits 2026-10-12 22:51:53 +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