Commit Graph
853 Commits
Author SHA1 Message Date
bmottin 1663b09bc5 Merge bugfix/macos-installer into develop 2026-09-15 21:43:07 -04:00
bmottin 09727c7f8a Merge bugfix/macos-gnu-coreutils into develop 2026-09-15 21:43:07 -04:00
bmottin 785e7922c5 Merge bugfix/macos-bash32-portability into develop 2026-09-15 21:43:06 -04:00
bmottin 1da870bd67 Merge bugfix/url-guard-ssrf-bash32 into develop 2026-09-15 21:42:56 -04:00
bmottin 28211a78ea fix(install): unblock the installer on macOS — BSD sed, and a deadline on Chromium
Two independent failures, both of which stopped `make plugin` outright here.

GNU `sed -i` takes no suffix argument; BSD sed requires one and reads the
script as that suffix, so all three calls errored — and under `set -euo
pipefail` that aborts the installer. They go through a temp file now, written
back with `cat >` so the profile keeps its mode and owner.

While rewriting them: the orphan-comment cleanup `{N; /^\n$/d;}` could never
match on ANY platform — after N the pattern space starts with '#', so the
^\n$ anchor pair never applied. It was a silent no-op, now awk, and tested on
/bin/bash 3.2: both obsolete entries and their stranded headers go, the live
entry and the user's own lines stay, idempotent on re-run.

The second failure was worse because it was invisible: gstack's ./setup runs
`bunx playwright install chromium` unbounded, and Playwright 1.58.2 deadlocks
on Node 26 mid-extraction — both processes idle at 39/333 files, no error, no
progress, forever. That silently cut the 2026-09-13 run at step 2 of 10.
Chromium is now installed here instead, under a 900s deadline; on timeout the
installer bumps gstack's Playwright (its package.json declares "^1.x", so a
minor bump is in range) and retries once, then warns rather than aborts —
gstack is OFF by default and only its browser depends on this.

`timeout` is not in a stock macOS, so the deadline is pure bash. Proven by a
forced hang: rc 124 in 6s, no orphaned oopDownloadBrowserMain, stderr clean.
2026-09-13 17:21:23 -04:00
bmottin a4565c80c3 fix(portability): stop assuming GNU coreutils flags on macOS
BSD userland rejects or silently ignores several GNU spellings the repo used:

- `timeout` is not in a stock macOS at all (Homebrew installs it, and also as
  `gtimeout`). Without it every gates.sh check exited 127 and was recorded
  NOT-MET whatever the check actually did — a systematic false negative.
  The binary is now resolved once, with a pure-bash deadline behind it so the
  124 contract still holds where neither binary exists. GATES_TIMEOUT_BIN is
  overridable with `-` not `:-`, so an empty value forces that fallback: the
  suite passes 64/64 both ways, timeout cases included.
- `touch -d '10 days ago'` is GNU-only; perl's utime is the one spelling both
  platforms ship.
- BSD `wc -l` pads its count with leading spaces, so string compares failed as
  got[      48] want[48].
- `sed -i` needs a suffix argument on BSD AND does not expand \n in the
  replacement, so the release-candidate CHANGELOG edit silently did nothing
  and the assertion failed for the wrong reason. Rewritten in awk; the RC_TAG=0
  mode still REDs on the absent tag, so the test keeps its teeth.
- `/bin/grep` does not exist on macOS (grep lives in /usr/bin), and `stat -c`
  is GNU-only.

fast-libs 11/11, seo-data 221/221, release-candidate 5 GREEN / 0 RED.
2026-09-13 17:21:09 -04:00
bmottin f3919b6ace fix(portability): replace bash 4 builtins absent from macOS bash 3.2
macOS ships bash 3.2 as /bin/bash, which `#!/usr/bin/env bash` resolves to
when no newer bash is on PATH. Two builtins the repo relies on do not exist
there, and both failed SILENTLY:

- `mapfile` in the three surgical-commit helpers left every array empty, so
  the scope guards passed on nothing (fail-OPEN) and the commits degraded to
  "nothing pending — no-op" while reporting success. deploy-commit.test.sh
  went 4/16; memory and doc commits simply never happened.
- `declare -A` in the session-start hook errored on every session and left
  each plugin cost at 0, so the passive-budget warning could never fire.

`_read_lines_into` is the portable equivalent of `mapfile`, space-safe and
resetting its target first — expanding a never-assigned array trips `set -u`
on bash < 4.4, which is how the empty arrays surfaced as "unbound variable".
Plugin costs move to a `case`.

source-scope.sh's header prescribed `mapfile` to its callers; it now shows
the read loop, and its own test plus run-reconcile.sh stop using the builtin.

deploy-commit 16/16, source-scope 34/34, run-reconcile 25 GREEN / 0 RED,
session-start stderr empty.
2026-09-13 17:20:57 -04:00
bmottin 5efc506197 fix(url-guard): restore the SSRF guard on bash 3.2
`${1,,}` is bash 4.0+. macOS ships bash 3.2 as /bin/bash, where it raises
"bad substitution"; the subshell then exited 1 — read as "not local" — so
`url-guard.sh host` returned rc 0 for localhost, 127.x, 10.x, 192.168.x,
172.16-31.x, 169.254.169.254 and metadata.google.internal. The guard failed
OPEN on every Mac, and url-guard.test.sh recorded it as 13 "got[0] want[2]".

`shopt -s nocasematch` (bash 3.1+) keeps both the ASCII-only folding that
LC_ALL=C gives and the no-fork property the lowercase expansion had.

Verified on /bin/bash 3.2: the ten local/private/metadata targets now return
rc 2 (case-folded variants included), legitimate hosts still rc 0.
2026-09-13 17:20:43 -04:00
Bastien Chanot a53a5a26a8 Merge release/1.5.0 into develop 2026-09-13 21:26:44 +02:00
Bastien Chanot 9b3b96a8f2 chore(release): 1.5.0 — version.txt + CHANGELOG 2026-09-13 21:25:37 +02:00
Bastien Chanot 8d5d154c28 chore(memory): LRN-149 — background_tasks gates the turn-end signal 2026-09-10 03:03:22 +02:00
Bastien Chanot 0e8018ae7b fix(hooks): no turn-end signal while background work runs
Ending a turn right after spawning a subagent fired the bell and a toast
saying the response was finished, while the work continued. The Stop
payload carries background_tasks, so skip the signal when it is not
empty; the next turn end signals once the work is really done.

Interaction requests still signal during background work. A missing
field still signals, so an older client loses nothing. Also drop the
message suffix when it merely restates the label.
2026-09-10 03:03:22 +02:00
Bastien Chanot 12d7fc1483 fix(hooks): stay silent on events that need no attention
Only turn end and the moments needing the user should signal. Any other
event reaching the hook, such as agent_completed or auth_success, now
exits without emitting, so a subagent finishing rings nothing even if the
Notification matcher is ignored.
2026-09-03 02:56:49 +02:00
Bastien Chanot e801b90307 Merge chore/notify-terminal-preflight into develop 2026-09-03 02:26:16 +02:00
Bastien Chanot 92eb27c4e2 Merge feature/notify-event-labels into develop 2026-09-03 02:25:38 +02:00
Bastien Chanot 679c2cda7b feat(hooks): label each attention event in the toast
The toast body showed Claude's own message when present and the raw
notification_type otherwise, so permission_prompt and idle_prompt reached
the user as snake_case. Map every event the matcher covers to a readable
label, and keep Claude's message as a suffix when it adds detail.
2026-09-03 02:24:51 +02:00
Bastien Chanot 2c0439a0a8 chore(memory): LRN-148 — pre-flight terminal test; LRN-147 mechanism too narrow 2026-09-03 02:22:24 +02:00
Bastien Chanot 2ed51573f7 Merge chore/notify-restored-terminal into develop 2026-09-03 02:00:47 +02:00
Bastien Chanot a627201bee chore(memory): LRN-147 — restored terminals never instrumented by OSC ext 2026-09-03 02:00:22 +02:00
Bastien Chanot f90ee74a19 Merge feature/notify-stop-event into develop 2026-09-03 00:31:07 +02:00
Bastien Chanot 6aca40a810 chore(memory): BDR-087 + LRN-146 + BLK-020 — capitalize 2026-09-03 00:28:45 +02:00
Bastien Chanot ea9e5c1dab feat(hooks): ring terminal on turn end via Stop hook
Notification matcher covers input-needed events only; end of turn had no
signal but idle_prompt, ~60s late. Wire notify-attention.sh on Stop too,
branching on hook_event_name for the message. Signal only: returns
terminalSequence + suppressOutput, never blocks (guard vs BDR-083).

Header documents both client-side prerequisites found in BLK-020.
2026-09-03 00:28:40 +02:00
Bastien Chanot de34e3f167 Merge chore/reconcile-todo into develop 2026-09-01 16:55:55 +02:00
Bastien Chanot 069a73338a chore(todo): reconcile 2026-09-01 — T4 gate ticked, T6 residuals corrected, Makefile item re-verified open 2026-09-01 16:54:15 +02:00
Bastien Chanot 1940a0a22a Merge chore/notify-attention-bell into develop 2026-09-01 16:40:51 +02:00
Bastien Chanot c4e6ef1e2b chore(memory): BLK-019 notify-attention bell silent (VS Code client default) 2026-09-01 16:30:39 +02:00
Bastien Chanot 08e38876ee Merge chore/notify-attention-hook into develop 2026-09-01 15:42:25 +02:00
Bastien Chanot f08c3ab51c chore(memory): LRN-145 terminalSequence pattern + journal 2026-09-01 2026-09-01 15:32:51 +02:00
Bastien Chanot 6c04ada6a8 chore(settings): default model opus[1m] (was claude-fable-5[1m]) 2026-09-01 15:32:25 +02:00
Bastien Chanot 1d7faa32b5 chore(hooks): notify-attention — bell + OSC 777 toast when Claude needs input
Notification hook (permission_prompt|idle_prompt|agent_needs_input|
elicitation_*) returns BEL x2 + OSC 777 via the terminalSequence JSON
field (hooks have no controlling TTY). Client side over Remote-SSH:
VS Code accessibility.signals.terminalBell sound:on for the beep,
wenbopan.vscode-terminal-osc-notifier extension for the Windows toast.
2026-09-01 15:32:18 +02:00
Bastien Chanot 726464f387 Merge feature/darwin-optimize-20260825 into develop 2026-08-27 11:54:35 +02:00
Bastien Chanot a51a65e1d5 chore(memory): LRN-143 index row — re-escape pipes (sed a-command unescaped them) 2026-08-26 23:01:16 +02:00
Bastien Chanot a15854aa87 chore(memory): EVAL-028 + LRN-143/144 + BDR-086 + journal — darwin run capitalized; TODO round-count corrected 2026-08-26 23:00:41 +02:00
Bastien Chanot 7f457f09fd docs(darwin): result card PNG 2026-08-26 23:00:41 +02:00
Bastien Chanot 12823181d1 chore(darwin): Phase 3 — optimization report + TODO T5/T6 ticked 2026-08-26 22:45:03 +02:00
Bastien Chanot e157a98e0b fix(hotfix): rewrap RULES bullet — census greps the no-verifier phrase on one line 2026-08-26 22:40:04 +02:00
Bastien Chanot 6eac7fbca9 fix(hotfix): batch-skeptic residuals — RULES restore mandate file-scoped; hotfixer FILE(S) marks created files (new) 2026-08-26 22:28:31 +02:00
Bastien Chanot b5ce280fc0 fix(fixtures): plugin-check expects PLUGIN CHECK block + real plugin names; onboard archetype nextjs-app-router 2026-08-26 21:59:56 +02:00
Bastien Chanot 6c69ae1670 fix(prune-memory,code-clean): stale v1-untested note reflects real tests/; executor attribution code-cleaner (refactorer inline); audit-only fixture matches flow 2026-08-26 21:59:40 +02:00
Bastien Chanot ad4985f410 fix(security-auditor,close): hotfix no-verifier carve-out documented; close enumerates STEP 5C + --no-push passthrough 2026-08-26 21:59:08 +02:00
Bastien Chanot c983f1ff94 fix(handover-writers): stale ch.4 refs post-NAP-renumbering (glossary/tone->6, cross-links/THRESHOLD->5); 14.5 verification deferred to post-write; anchor gate ordered into STEP 16 2026-08-26 21:55:13 +02:00
Bastien Chanot 27f17939d7 fix(plan-challenger): ERROR verdict added to the load-bearing OUTPUT grammar (STEP 1 emitted it, parser enum omitted it) 2026-08-26 21:54:35 +02:00
Bastien Chanot ab75fc5e1f fix(harden): severity rule defers to the calibrated guide; SSL Labs late-finalize gets an assigned actor (main loop edits HARDEN.md row) 2026-08-26 20:35:35 +02:00
Bastien Chanot 1743f7683f fix(init-project,commit-change,tour): allowed-tools +Agent+Skill; conflict grep covers all unmerged codes; report-only never commits 2026-08-26 20:35:06 +02:00
Bastien Chanot 6eceedb8d3 fix(hotfix): revert paths — stash-create PRE snapshot + file-scoped restore (git restore . wiped tolerated user edits); security gate fresh-dispatch only 2026-08-26 20:34:45 +02:00
Bastien Chanot 796b52ea6b optimize gitflow r1-amend: judge-suggested precisions (re-checkout source before re-run; purge warning is pre-merge, finish continues) 2026-08-26 19:59:24 +02:00
Bastien Chanot 056f82b25f optimize gitflow: d3 — mechanical failure table keyed to lib return codes (rc=4 conflict resume, rc=2/3/1 start paths, best-effort purge, socle abort) 2026-08-26 19:57:21 +02:00
Bastien Chanot 9428b86880 optimize status-reporter r2: d5 — passive cost sourced from doctor.sh constants (skeptic's find), count-only fallback kept 2026-08-26 19:44:03 +02:00
Bastien Chanot a3f1624b15 optimize status-reporter: d5 — unproducible token field replaced by /plugin-check deferral; dead ROADMAP.md row rewritten for post-ADR-013 gsd layout 2026-08-26 19:35:46 +02:00
Bastien Chanot e9c6bf52fa optimize analyze-system: d1 triggers in skill description + d2 ordered TASKS mapped to OUTPUT sections in analyzer 2026-08-26 19:22:36 +02:00