Commit Graph
749 Commits
Author SHA1 Message Date
AIOSAIandClaude Opus 4.8 beb048dadf fix(hooks): presence_gate keys per-branch via hook_data cwd; engine propagates block exit code (FPLAN-0289 P1)
Activation fixes for the single-session presence gate. Two bugs blocked it,
both caught by live testing after all units were green:

1) Wrong branch key. presence_gate used Path.cwd().name, but under the Claude
   Code bridge the hook process cwd is the project root, so every session keyed
   to "AIPass": the gate never enforced one-live-session-per-branch and would
   have rejected sessions project-globally (any 2nd interactive session in any
   branch). Now _resolve_branch(hook_data) reads the event payload's cwd (the
   real session dir) and walks up to the branch root (.trinity/ or apps/),
   mirroring branch_loader. Applied in handle() and handle_stop().

2) Block never reached Claude Code. engine.dispatch() returned only stdout, so
   the bridge could not surface a non-zero exit. dispatch() now returns
   (stdout, exit_code) and the bridge exits with it on a block. Pre-existing gap
   affecting every block hook on every event; now fixed engine-wide. An
   intentional block (exit 2 + {"decision":"block"}) propagates; a crashing hook
   (exit 2, non-JSON stdout) is logged and falls through, so the gate fails open.

Proven: 110 hooks unit tests pass (6 new for branch resolution); seedgo @hooks
100%, no type errors. Live bridge end-to-end (real live holder + real bridge):
duplicate into a held branch -> exit 2 + block reason naming the branch; a
different free branch -> exit 0 (per-branch isolation intact). Gate remains
dormant: not yet wired into provider settings.

Design: DPLAN-0225 / FPLAN-0289 P1 activation. Build by @hooks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CqoxFdbDMirzkQ5kjRVVos
2026-06-29 17:46:09 -07:00
AIOSAIandClaude Opus 4.8 8d775b4bd2 feat(skills): TG bot follows PRESENCE pointer, retire legacy own-spawn (FPLAN-0289 P2)
The Telegram bot becomes a thin durable relay: it follows the live Claude session
via .ai_central/PRESENCE.central.json and never starts its own brain.
ensure_tmux_session resolves in 3 strategies (central pointer -> shared_session
config -> already-running own tmux), re-binding to the live session on every message
(handover-safe). The legacy AIPASS_SESSION_TYPE=telegram own-session spawn is retired:
replaced with a clear "no live session to mirror" error; an absent/stale pointer falls
back gracefully and never starts a session. on_session_create (which injected "hi"
after self-start) removed as obsolete -- attaching to a live session injects nothing.

New helpers: _find_presence_file, _read_presence_pointer (PID-liveness via os.kill),
_find_tmux_for_presence (attach_handle preferred, tmux-CWD-scan fallback).

601 TG + 252 skills tests pass; seedgo Unused_Function 100% (overall 99%; residual is
a pre-existing Json_Handler item in unrelated modules). Live mirror proof to follow.
Design: DPLAN-0225 / FPLAN-0289 P2. Build by @skills.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFihce1oLtp6UDAPGryYSv
2026-06-29 14:54:50 -07:00
AIOSAIandClaude Opus 4.8 13983b614a fix(hooks): presence tests cross-platform — patch _presence_lock not fcntl (FPLAN-0289 P1)
Windows CI was red on f460cd5: the patch_flock fixture patched presence.fcntl,
which only exists on POSIX (msvcrt on win32), erroring all 16 presence-test
setups. Now patches the platform-agnostic _presence_lock context manager
(-> nullcontext per call) and skips the inherently-POSIX flock-acquire test on
win32. Dormant prod code unchanged.

705 tests pass, seedgo 100%. Fix by @hooks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFihce1oLtp6UDAPGryYSv
2026-06-29 14:16:02 -07:00
AIOSAIandClaude Opus 4.8 f460cd577e feat(hooks): presence service + single-session gate, dormant (FPLAN-0289 P1)
One live Claude runtime per branch. presence.py manages .ai_central/PRESENCE.central.json
(claim/release/refresh, PID + /proc/cwd liveness, stale-reclaim, PID-guarded release so a
non-holder can never release the holder). presence_gate.py: UserPromptSubmit blocks a
duplicate (exit 2 + decision:block), Stop releases; skips sub-agents + dispatched/daemon.

SessionStart can't block in Claude Code (inject-only) → gate is UserPromptSubmit, like the
edit/git gates. NOT wired into hooks.json yet — dormant, zero behavior change until enabled.

705 tests pass, seedgo 100%. Live cross-process block + PID-guard verified (devpulse).
Design: DPLAN-0225. Next: P2 telegram relay follows the pointer (@skills).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFihce1oLtp6UDAPGryYSv
2026-06-29 13:51:48 -07:00
AIOSAI 2217b96054 fix(skills): Windows CI — mirror transcript slug strips backslashes; tests drop platform tricks (TDPLAN-0009)
base_bot.py _resolve_active_transcript: slug replaces both backslash and / (Windows work_dir paths left backslashes → wrong projects_dir; POSIX no-op). test_mirror_session.py: slug matches production + mkdir exist_ok=True (dir pre-created on Windows → WinError183). test_monitor.py: mock _save_monitor_subscription→False instead of /dev/null OSError trick. 578 TG + 252 skills green on Linux; Windows-safe by construction. Fix by @skills, verified by devpulse.
2026-06-29 10:46:54 -07:00
AIOSAI bd57573764 fix(seedgo): audit always ignores .archive/ — full stop (Patrick directive)
readme_check.py: _count_test_functions now skips any path with a SOURCE_SKIP_DIRS segment (.archive) — root cause of the local-vs-CI test-count mismatch (daemon counted 486 local incl archived dead tests vs 300 in CI clean checkout). test_quality_check.py: _find_test_files_broad replaced __pycache__-only skip with _should_skip_dir() on all path parts. Daemon 486→300, audit 100%, 17-branch audit zero regressions. CI-neutral (clean checkout has no .archive). Fix by @seedgo, verified by devpulse.
2026-06-29 10:30:37 -07:00
AIOSAI 8d2dcdcc77 fix(daemon): README test count 486→300 (live count; 486 wrongly included .archive dead tests)
CI's clean checkout counts 300 live tests (matches pytest); README claimed 486 because the count included 6 archived dead-test files under tests/.archive/ (186 tests). 300 is the true live/CI count. Root-cause framework fix (audit must always ignore .archive) dispatched to @seedgo separately.
2026-06-29 10:17:20 -07:00
AIOSAI 3d66e8397b fix(daemon): seedgo 100% — archive dead cron orphans, queue introspection bypass, exception-contract test, README count (TDPLAN-0008)
Diagnostics 65%→100%: archived dead orphans scheduler_cron.py + modules/scheduler_ops.py (+ their test_scheduler_cron.py) — old cron scheduler superseded by queue/run_tick (S254), imported only by already-archived files; cleared 7 pyright unresolved-import errors. Introspection 98%→100%: bypass queue.py (td-47 — bare invocation renders operational Rich table). Test_quality 98%→100%: added test_invalid_mode_raises. README count fixed. Cleaned 6 stale bypass entries. Audit @daemon=100% (38 standards), 300 tests green. Fix by @daemon, verified by devpulse.
2026-06-29 10:00:07 -07:00
AIOSAI 9e988a63b3 fix(daemon): CI green — .archive-existence tests → import-path assertions; bare 'queue' renders Rich table (TDPLAN-0008, td-47)
test_scheduler_bot.py: replaced test_data_files_archived + test_handler_files_archived (asserted gitignored .archive paths → failed in CI clean checkout) with test_task_registry_not_importable + test_actions_registry_not_importable (assert ImportError — env-independent). queue.py: bare 'drone @daemon queue' now renders the Rich table instead of print_introspection (matches --help). 24 scheduler_bot tests green. Fix by @daemon, verified by devpulse.
2026-06-29 09:37:43 -07:00
AIOSAI 88e99efe4c feat(skills,hooks): TDPLAN-0009 Telegram session mirror — bidirectional, live-proven @api
@skills: dup-spawn fix (run() lock-collision exit 0), attach_only + launch_mirror_session (--dangerously-skip-permissions), _config_chat_id init bug + /proc active-transcript baseline, systemctl start. @hooks: extract_mirror_turn cursor clamp + baseline reset on delivery, mirror-file unlink guards. +4 test files. 578 skills / 112 hooks green.
2026-06-29 08:53:03 -07:00
AIOSAI 4363f9824a fix(skills): SchedulerBot.run() crash-looped on real ExecStart — wrap super().run() (TDPLAN-0008)
- run() called a non-existent self._poll_loop() AND duplicated the parent lifecycle incompletely (missing signal handlers, offset load/save) — bot exited 1 in <1s under systemd. Now wraps super().run() with digest start/stop only.
- Fixed broken 'from .json import json_handler' (relative path did not exist) → absolute import; log queue_requested op so json_structure standard is met by use, not noqa
- Added missing docstrings: handle_message / handle_file / get_custom_commands
- ROOT CAUSE: 26 unit tests never executed run() (it blocks on polling) → green tests, failing ExecStart (key-learning #77: test the real ExecStart, not the drone/mocked form). Verified live: bot now active+polling via systemd, 26 tests + seedgo 30 still green.
2026-06-25 17:04:31 -07:00
AIOSAI d252403d37 feat(skills): Scheduler Bot Phase 2 — dedicated bot /queue + hourly digest (TDPLAN-0008)
- SchedulerBot(BaseBot): rejects free-text (NO tmux/Claude spawn), /queue shells 'drone @daemon queue --json', hourly digest thread, chunked output
- base_bot __main__: _BOT_CLASSES maps bot_id->SchedulerBot for systemd launch; passes config chat_id for digest target
- bot registered (telegram-bot@scheduler), systemd unit installed (NOT started)
- 26 new tests (519 telegram / 252 skills green), seedgo 99%

fix(daemon): queue --json emits valid JSON at module level — flatten prompt_preview (collapse newlines) + soft_wrap/markup off. Verified valid via 'python -m'. NOTE: the drone router still re-wraps sub-command stdout at width 80, corrupting machine --json for ALL consumers routed through drone (separate @drone core bug; skills mitigates with strict=False JSON parse).
2026-06-25 16:56:56 -07:00
AIOSAI b51ac87eb7 feat(daemon): Scheduler Bot Phase 1 — unified queue + status capture + lifecycle telegram pings (TDPLAN-0008)
- One queue: archive dormant task_registry + actions_registry (+5 tests) to .archive/, retire schedule/actions CLIs; .daemon/schedule.json is now the single source
- Status capture: runstate gains last_status/last_error/last_success_at/last_failure_at; persisted on success AND failure paths (was success-only)
- Unified view: drone @daemon queue + --json (frozen schema), aggregates .daemon/*.json joined to runstate
- Lifecycle pings: un-archived telegram_notifier wired to @skills send_telegram_notification (fail-soft, per-job notify flag, zero calls on empty ticks)
- 24 new tests (327 pass), seedgo 98%; verified live end-to-end (queue --json schema + real telegram delivery via daemon wrapper)
2026-06-25 16:36:10 -07:00
AIOSAI 1d3094acee fix(ai_mail): escape systemd cgroup for daemonized wakes (td-48) 2026-06-25 08:15:37 -07:00
AIOSAI 5b7fa2d4ad docs(daemon): self-sufficient run --help (schema/types/example) + README scheduling section (FPLAN-0287) 2026-06-25 07:10:49 -07:00
AIOSAI f832a558cd feat(daemon): systemd user timer auto-runner — decentralized scheduler fires hands-off (FPLAN-0287) 2026-06-25 06:31:05 -07:00
AIOSAI a777251ab7 fix(skills): bypass telegram ported-but-unwired fns (seedgo-audit) + document
DPLAN-0218 pulled telegram into the seedgo gate, surfacing 16 unused_function
flags across 8 handlers. They are ported-but-unwired (S249), not dead — pending
DPLAN-0220 wiring. Added name-scoped unused_function bypasses citing DPLAN-0220,
documented each in SKILL.md -> Ported-but-unwired (remove bypass as wired).
@skills 100%.
2026-06-25 04:17:19 -07:00
AIOSAI 1794c8f954 fix(spawn): use json_handler.read_json for passport in adopt path
core.py adopt-path read the passport via json.loads(read_text()) — a direct
file op that fails the json_handler standard and the CI seedgo-audit gate.
Switch to json_handler.read_json() (matches the pattern ~90 lines above),
drop the now-unused 'import json as _json'. @spawn 100%; 315 spawn tests green.
2026-06-25 04:01:50 -07:00
AIOSAI 7e9c0cfca7 fix(telegram): make Windows-unmasked tests cross-platform
Guarding the fcntl import let Windows collection succeed, which surfaced 3
telegram tests that had never run on Windows — all test-portability bugs:
- log_streamer byte-count broke on CRLF -> fixture writes newline=''
- bot_registry write-failure used Unix-only /proc -> file-as-parent (all OS)
- validate_bot_config rejected POSIX work_dir on Windows (Path.is_absolute is
  host-dependent) -> test absoluteness under PurePosixPath OR PureWindowsPath
493 telegram tests green on Linux; ruff clean.
2026-06-25 03:44:26 -07:00
AIOSAI ec6e966137 fix(telegram): guard fcntl import for Windows — unblock CI test collection
bot_registry did a bare 'import fcntl' (POSIX-only); on Windows the 8
telegram test modules importing it failed at collection (ModuleNotFoundError),
reddening Windows Test on recent PRs. Guard the import and route flock calls
through no-op-on-Windows _lock/_unlock helpers. 246 telegram tests green.
2026-06-25 03:18:58 -07:00
AIOSAI fbf102c636 feat(memory,spawn): self-documenting .trinity state-tabs + todo delete-on-done discipline
- .trinity sections carry config-sourced rollover/keep/char-cap tabs; @memory owns
  values (render_all_meta_tabs), @spawn resolves placeholders at create via spawn_pusher
- todos confirmed rollover-exempt; vestigial rollover-config entry removed
- prep/memo/startup (Claude+Codex): delete finished todos, don't leave status:done
- @memory README documents the system
- FPLAN-0285, FPLAN-0286
2026-06-25 03:00:36 -07:00
AIOSAI be8f87d6fb feat(prax): monitor→Telegram relay (prax_monitor bot) + fix service feedback loop
Mirrors the live 'drone @prax monitor run' Mission-Control feed to a dedicated
Telegram bot (DPLAN-0221). New monitoring/telegram_relay.py taps _render_event,
batches every 5s (4000-split, 150 flood-cap, fail-silent-once), gated by
--relay/env so local monitor stays console-only. Reboot-survivable
prax-monitor.service. 937 prax tests green (31 new).

Deploy fixes (devpulse): ExecStart -> 'monitor run' (module __main__ rejects
'run all --relay'); service log moved out of system_logs/ to ~/.aipass/ to break
a monitor<->@trigger feedback loop.
2026-06-25 00:10:06 -07:00
AIOSAI 97b884bef7 feat(skills): prax-monitor v1 on Telegram — /monitor system-wide log subscription
Revives the old prax-monitor capability as a feature of the existing
@aipass bot (no 2nd bot, no new credential). /monitor on|all|off|status
on base_bot; subscribed chat persisted to @api (survives restart) and
boot-started on startup. LogStreamer gains system_wide glob + level_filter
(default WARNING/ERROR/CRITICAL, all=passthrough). 33 new tests,
telegram 493/493, skills 252/252, seedgo 98%.

Route B (true AS-WAS @prax event-feed relay) tracked separately.

DPLAN-0221
2026-06-24 20:48:17 -07:00
AIOSAI d41ecd9877 fix(skills,ops): deploy @aipass telegram bot under systemd + fix unit log path
The ported telegram-bot@.service logged to a non-existent ~/system_logs
(would crash-loop the service); point StandardOutput/StandardError at
<repo>/system_logs where the app already logs. Then installed the unit,
enable --now + loginctl enable-linger so the @aipass mother-bot runs as a
proper user service with reboot survival and a one-line restart. Startup
log confirms: Telegram API OK, Command menu set (6 commands), poll loop,
tmux session preserved, NRestarts=0.

DPLAN-0220
2026-06-24 17:28:44 -07:00
AIOSAIandClaude Opus 4.8 bf301bc231 feat(telegram): /help + command menu — startup populate, single source, enriched (DPLAN-0220)
Resolves the build_botfather_commands design call (Patrick: KEEP, not delete).

POPULATE: base_bot sets its Telegram command menu on startup (setMyCommands)
after verify_connection, so every bot — base or minted — gets a populated
slash-menu, not just create_bot'd ones (the live @aipass was hand-launched
and had none).

SYNC: build_botfather_commands (telegram_standards) is now the single source
feeding base_bot-startup AND create_bot; DEFAULT_BOT_COMMANDS retired. The
Telegram menu and /help list the same commands incl. /create + /cancel.

ENRICH: friendlier command descriptions + /help intro/footer.

Wiring the builder (vs deleting it as 'dead') lifted Unused_Function 92->93%.
6 new tests (menu==help sync, enriched copy, startup-menu, custom cmds);
telegram 460/460, skills 252/252. Running bots need a restart to pick up the
startup menu.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 16:59:07 -07:00
AIOSAIandClaude Opus 4.8 9af4c8ac05 feat(telegram): close GAP1 — create_bot persists config to @api so minted bots start (DPLAN-0220)
bot_factory.create_bot now calls set_secret('telegram', bot_id, config,
as_json=True) right after building the config (fail-loud on OSError), so a
newly-minted bot's token reaches the @api store that load_bot_config reads.
The disk write is downgraded to a non-fatal shadow; registry now records
bot_token_ref='@api:telegram/{id}' (TG-LIFE-069).

Proven: new TestCreateBotRoundTrip — create_bot -> @api -> load_bot_config
returns the persisted config; + a fail-loud test (set_secret OSError ->
create_bot returns None). Telegram 454/454, skills 252/252.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 16:49:06 -07:00
AIOSAIandClaude Opus 4.8 0096aef1d2 feat(telegram): port wave-1 fixes + @api set_secret write-door (DPLAN-0220)
Surfaced by a full completeness audit of the telegram skill against
TELEGRAM_PORT_MAP.md (366 tags, ~83% ported, 452/452 tests green).

@api — in-process set_secret(provider, slug, value, *, as_json) writer
mirroring get_secret (0o600 files / 0o700 dirs, no stdout echo). The store
was read-only; this is the GAP1 enabler the telegram mother-bot needs to
persist a created bot's config. 515 @api tests, seedgo 100%.

@skills telegram wave-1 (fix-forward, no deletions):
- GAP2: bot_factory + telegram-bot@.service launched a non-existent
  ~/.venv/bin/python3; now sys.executable -m ...base_bot (+ lib/__init__.py
  and lib/telegram/__init__.py for package resolution).
- Reboot survival: enable_service now installs the unit to
  ~/.config/systemd/user/ + daemon-reload (was never installed).
- GAP9: gitignore lib/telegram/.local/ so runtime state stops leaking to git.
- prax-monitor: log_streamer now resolves repo-root system_logs (honoring
  AIPASS_TEST_LOG_DIR) instead of a hardcoded ~/system_logs.

Verified: telegram 452/452 green (twice), base_bot imports via -m.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 16:39:08 -07:00
AIOSAI 882da7cdfc refactor(skills): relocate skill library to src/aipass/skills/lib/ — rename catalog/, move telegram in, archive orphan fixtures, retire .aipass/skills/
Unifies all 6 first-party skills under lib/ (built-in tier). Fixes telegram not
being cross-branch discoverable (was in cwd-relative .aipass/skills/). Built-in
discovery path catalog->lib; telegram conftest parents[6]->[5]; .service
ExecStart, seedgo bypass + test paths updated. Packaging/imports/gitignore
unaffected (stays under src/aipass). 252/252 tests green, cross-branch discovery
verified. DPLAN-0218.
2026-06-24 14:24:28 -07:00
AIOSAIandClaude Opus 4.8 57767cc2a9 fix(api): render 4 module --help functions in Rich (caught by tightened CLI checker)
The CLI help-checker fix (4d41065) immediately surfaced the same
console.print(parser.format_help()) laundering in 4 @api modules on its first
audit run — exactly the latent stragglers the static-scan loophole had been
hiding. Rewrote each print_help() to hand-rolled Rich markup (content was
already in the argparse epilogs); removed the help-only argparse parsers.

- api_key.py, usage_tracker.py, google_client.py, openrouter_client.py
- @api audit Cli + Overall back to 100% (38/38), 504 tests pass, no bypass

DPLAN-0217 (follow-on).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 12:26:34 -07:00
AIOSAIandClaude Opus 4.8 4d4106505f fix(seedgo,ai_mail): close CLI help-checker loophole + render ai_mail --help in Rich
seedgo's cli/help_text/introspection standards are static source scans — they
confirm a print_help function, console.print, and --help wiring exist, but never
execute --help. So a module could score 100% while rendering raw argparse.
ai_mail did exactly that via console.print(parser.format_help()), laundering
argparse plain text through the approved console API and dodging the existing
parser.print_help() ban.

- seedgo: cli_check now flags .format_help(); cli.md/cli_content.py name it
  alongside print_help(); +2 regression tests (1095 pass, self-audit 100%)
- ai_mail: rewrote print_help() to hand-rolled Rich (737 tests pass); --help now
  renders Rich with no raw argparse, Cli back to 100% legitimately
- behavioral --help check (run it, assert not raw argparse) noted as a follow-up

DPLAN-0217.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 11:58:53 -07:00
AIOSAI 4af5b8bf63 refactor(backup): move .backupignore seed from code to templates/ data file
Backup was the outlier — its default .backupignore content was hardcoded as the
BUILTIN_IGNORES Python list + assembled in _build_backupignore(). Moved it to a
template DATA FILE (backup/templates/backupignore.template), matching the AIPass
convention (flow/spawn/memory all keep templates as files).

- New: templates/backupignore.template (header + patterns, incl logs/).
- _build_backupignore() reads the template via __file__-relative pathlib and
  RAISES FileNotFoundError if it's missing — never silently empty (an empty
  .backupignore = back up everything = crash). Behavior-preserving otherwise.
- Retired BUILTIN_IGNORES (only setup.py consumed it). Runtime load_spec path
  untouched.
- Tests expanded (30 pass): per-pattern template assertions + reads-template +
  raises-on-missing-template. Docs/comments repointed to the template.

seedgo @backup 100%. td-30.
2026-06-24 09:39:51 -07:00
AIOSAI 70cf31eb3e docs(backup): document seed-vs-runtime ignore architecture + add logs/ default
Confirmed (via @backup) the two-layer ignore model and wrote it down so it stops
getting re-discovered:
- BUILTIN_IGNORES (patterns.py) = the SEED that generates a new project's
  .backupignore at register; never consulted at backup time.
- .backupignore (via load_spec) = the runtime source of truth. No static
  fallback exists, so the seed is safety-critical — an empty .backupignore backs
  up everything (.venv, node_modules, .git) and can crash the machine.

Added a 'How Ignores Work' README section + code comments on BUILTIN_IGNORES and
load_spec. Added logs/ to the seed so new projects exclude log dirs (prax .jsonl
output) by default, not just *.log files, with a test. seedgo @backup 100%.

td-27.
2026-06-24 09:21:34 -07:00
AIOSAI c1dba78d31 fix(ai_mail): scope dispatch-footer plan-close to worker's own plan
The standard email footer told dispatched agents 'CLOSE FPLAN -> drone @flow
close <plan_id>', which led them to close the orchestrator's master/parent plan
referenced in their brief (bit us in FPLAN-0260). Reworded to 'CLOSE YOUR PLAN
-> ... this task's plan only, never the master/parent': a worker still closes the
sub-plan handed to it, the master stays the orchestrator's to close on completion.

td-6. Footer string + test assertion; 737 ai_mail tests pass.
2026-06-24 07:21:35 -07:00
AIOSAIandClaude Opus 4.8 d8d2c4f32d docs(memory,flow): cross-ref shared .backup/ namespace + drop stale prax/.backupignore
Completes the backup-docs sweep (td-218):
- @memory README: note rollover writes rollover_backup_*.json to <branch>/.backup/
- @flow README: note closed plans archive to <repo-root>/.backup/processed_plans/
  both cross-referencing @backup's canonical README.
- Removed orphaned src/aipass/prax/.backupignore (prax is not a registered
  backup target; only the AIPass project root is).

seedgo green across all three (@flow 100, @memory 100, @prax 99 = pre-existing
Json_Handler, unrelated).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 07:00:36 -07:00
AIOSAIandClaude Opus 4.8 40602702ef docs(backup): correct backup/.backup/.backupignore docs across the system
Streamlined prompts had drifted from reality. Full-context investigation
(3 agents + @memory storyline) corrected:

- .backup/ documented as a SHARED runtime namespace (3 writers: @backup
  snapshot stores, @memory rollover safety copies, @flow processed_plans),
  not @backup-exclusive.
- @backup README: full 11-command coverage, .backup/ store layout, and a
  .backupignore (gitignore-for-backups: pathspec/gitwildmatch, BUILTIN_IGNORES,
  self-exclusion, ships as config) section.
- @backup branch prompt: stale .backup_system/ -> .backup/ (3x), drive_test.py
  -> drive_check.py (was misleading the agent every turn).
- Root README: @backup added to roster + uninstall covers .backup/.backupignore.
  navmap @backup line corrected (Drive planned + shared namespace).
- Shipped root /.backupignore realigned to BUILTIN_IGNORES (dropped stale
  .backup_system/, removed over-broad *logs).
- Removed dead backup/run/ test dir.

@backup verified: 220 tests green, seedgo 100%. Closes td-218.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 06:51:18 -07:00
AIOSAIandClaude Opus 4.8 c771a22771 chore(trigger): retire dead bulletin_created dashboard writer
The bulletin_created event handler propagated a 'bulletin_board' section into
every branch dashboard, but it was fully dead: nothing fired the event, its
BULLETINS.central.json store no longer exists, and prax already prunes
'bulletin_board' via DEPRECATED_SECTIONS. Archived the handler to
events/.archive/, removed its import + trigger.on() registration, dropped the
5 covering tests (558 pass). seedgo audit 100%. prax pruning left intact.
Closes td-102.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 06:12:31 -07:00
AIOSAIandClaude Opus 4.8 feecd263eb fix(seedgo): name-scope unused_function bypasses (kill silent line-drift)
unused_function bypasses matched by file+line; the line was the function's
def line, so any code shift above it staled the bypass and silently re-flagged
the exempted function, dropping the branch below 100% (S216/S217).

Mechanism: is_bypassed() gains a 'functions' field + name param; name-scoped
match takes precedence, 'lines' kept for back-compat (no other standard
changes). unused_function_check passes the function name. +7 tests (1093),
seedgo self-audit 100%, bypass schema documented.

Migration: converted 10 line-scoped entries to functions: across
drone/memory/skills; removed 3 dead memory/vector_search entries already
pointing past EOF (file is 152 lines). drone/memory/skills re-audit:
Unused_Function 100% (names verified live). Closes td-009.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 05:51:54 -07:00
AIOSAIandClaude Opus 4.8 03c95e6881 fix(seedgo): readme_check honors (disabled) marker in module/test self-scans
readme_check did its own modules/ and tests/ globs that bypassed the
central audit collector, so an in-place foo(disabled).py tripped a false
'missing module' violation and inflated README test counts. Wire
is_disabled_file into both globs (check_module_list, _count_test_functions).
+2 regression tests, 1086 green, self-audit 100%. Closes td-103.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEQZXCtgnF3NQtcttTErpq
2026-06-24 05:21:02 -07:00
AIOSAI 6ffe1d3fca chore(release): bump to v2.6.0 + CHANGELOG release roll-up
Version bump 2.5.3 -> 2.6.0 (MINOR — ships compass v2, daemon scheduler, @backup
restoration, telegram skill, tiered prompts). Bumped in both pyproject.toml and
src/aipass/__init__.py. CHANGELOG top section enriched into a 2.6.0 release
roll-up so the GitHub Release notes read properly. Rides into PR640.
2026-06-23 17:02:47 -07:00
AIOSAI 68d0a23477 docs(devpulse): document compass module + refresh test count (236->282)
README Readme standard was at 75%: compass module/handler undocumented and the
test count had drifted. Added compass to the architecture tree + a Compass
command section, bumped tests 236->282, refreshed the date stamp. devpulse audit
back to 100%.
2026-06-23 16:29:26 -07:00
AIOSAI 6db606eb01 fix(memory,prompts): rollover repair + retire-for-all + seedgo #37 path cleanup
Batch of S243/S244 work held for PR640. Only devpulse has git write, so all
branches' changes (@memory, @prax, @hooks, @aipass, @skills, @flow, @backup,
@seedgo) land through this single commit.

Memory rollover (correctness):
- @hooks rollover hook now delegates to drone @memory rollover check/run — it
  had been reading stale .trinity limits (moved to memory.config.json by
  DPLAN-0210), falling back to a 600-line check that never fired, so rollover was
  silently dead for weeks. compact.py reads the current list schema. Both fail loud.
- @memory removed the v1 line-count/600 fallback entirely — v2-only, fail-loud
  (959 tests).

Retire-for-all (DPLAN-0215):
- Legacy global prompt fully removed across every runtime: global_loader.py +
  tests deleted, hooks.json/project_hooks.json blocks stripped, bootstrap global
  seeding removed, cadence default + bypass cleaned, global .md files archived.
  Codex SessionStart + Claude cadence read the same tier files.

Hardcoded-path cleanup (seedgo #37):
- New HARDCODED_PATH checker (#37). @memory symbolic.py + @prax branch_detector.py
  home paths -> dynamic/generic. Both 100% Hardcoded_Path.
- seedgo provider_hooks_snapshot.json fixture refreshed to the tiered baseline.

Genericization: patrick -> user across tracked source, docs, templates.
CHANGELOG: 2026-06-19 + 2026-06-23 sections added.
2026-06-23 16:17:10 -07:00
AIOSAI 6d1413cd5c feat(hooks): seed fresh-clone tier wiring across all 3 layers (FPLAN-0284 P5)
Closes the deployment gap — cadence_config.json + the settings.json bridge are machine-local (gitignored), so fresh clones needed the tiered wiring seeded from committed sources:
- cadence.py DEFAULTS (keystone): adds tier0(period 1) + navmap(period 5) to the code fallback, so a fresh clone with no cadence_config.json gets tiered cadence automatically (was defaulting tier0 to period 5).
- setup.sh: fresh-install bridge seed now emits tier0_kernel + navmap, drops global_prompt.
- provider_manifest.json: doctor update path adds the tiered entries on existing machines, drops global_prompt.

Convergence: the committed hooks.json (global_prompt enabled:false) means even a stale settings.json with a global bridge is skipped by the engine. 615/615 tests (1 new: test_defaults_include_tiered_loaders), seedgo 100%.
2026-06-18 18:01:56 -07:00
AIOSAI 81f55665e4 feat(skills): frontmatter discipline — when_to_use triggers + per-step success criteria (FPLAN-0284 P5/D2, DPLAN-0213)
Harvested from Claude Code's skill-authoring spec:
- when_to_use frontmatter field (trigger phrases) on all 3 SKILL.md templates + github catalog exemplar; discovery scan surfaces it so agents see triggers without loading the full body.
- Per-step 'Done when:' success criteria in the Steps section.
- 'Use when / Do NOT use when' structure in the When to Use section.

252/252 tests pass.
2026-06-18 17:57:54 -07:00
AIOSAI 2c91f79f2f feat(hooks): tiered prompt injection — Tier 0 kernel + Tier 1 navmap by cadence (FPLAN-0284 P2-P4, DPLAN-0214)
Replaces the single 8k always-injected global prompt with cadence-tiered injection:
- Tier 0 (.aipass/tier0_kernel.md, ~2k) injects EVERY turn — identity grounding, the drone --help reflex, disaster-preventer rules. Folds DPLAN-0213 C1 (faithful-reporting) + C2 (no-gold-plating sub-agent brief).
- Tier 1 (.aipass/tier1_navmap.md, ~7.7k) injects every 5th turn + session-start + post-compaction — full agent roster, framework, conventions, plus a new Terminology section migrated from the S211 backup.
- Old global_prompt loader retired (disabled in hooks.json, removed from cadence wiring); aipass_global_prompt.md kept as a reference snapshot.

Engine (built by @hooks): per-loader period in cadence.py should_fire() (back-compatible: unset period falls back to global); new tier0_kernel + navmap handlers; bypass.json extended to cover the two new dynamically-dispatched handlers. 614/614 tests pass, seedgo @hooks 100%.

Live-verified: tier0 fires every turn, navmap on turn 0/5/10, turn counter advances once per turn (not per loader), no double-injection. Machine-local wiring (cadence_config.json, ~/.claude/settings.json bridge) updated on this host; fresh-clone seeding of those is a tracked follow-up.

PROMPT_STYLE.md reference updated to point at the tier files as canonical examples.
2026-06-18 17:48:35 -07:00
AIOSAI b698dd8ce0 style(prompts): CC prompt-craft steals + cleaned S241 prompts (DPLAN-0213 A/B, FPLAN-0284 P1)
- PROMPT_STYLE.md: new 'Writing voice' section (file_path:line refs, no-colon-before-tool-call, no emojis, write-for-a-person, three-tier where-detail-lives) — harvested from Claude Code's own prompt
- devpulse local: blast-radius habit before any drone write-op (reversibility + scope)
- global + devpulse-local: S241 whitespace/structure cleanup (readable English restored)
2026-06-18 17:13:18 -07:00
AIOSAIandClaude Opus 4.8 ac1119de45 docs(compass): add 'compass vs @memory when-to-use' to devpulse local prompt (P5, DPLAN-0212)
Compass guidance now lives in the public local prompt (compass is public). Recall
-> @memory; decide/fork -> compass query; good/bad decision -> compass add;
Patrick fires /compass. Old gitignored private_prompt injection now redundant.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 13:59:44 -07:00
AIOSAIandClaude Opus 4.8 0d042dcb2f feat(devpulse): compass v2 P2 — drone @devpulse compass command (DPLAN-0212)
Thin command layer over the P1 storage core: add/query/stats/rate/archive/review
via drone @devpulse compass. Ratings shown in query output ([GOOD]/[BAD]/...),
--db flag for testing, auto-discovered (no devpulse.py change). 18 cmd tests,
seedgo 29/29, no regressions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 03:01:29 -07:00
AIOSAIandClaude Opus 4.8 0df8fee947 feat(devpulse): compass v2 P1 — SQLite/FTS5 rated decision store (DPLAN-0212)
Storage core for devpulse-owned Compass: decisions table + FTS5 BM25 search,
ratings (good/bad/impressive/interesting), add/query/stats/rate/archive/review.
Stdlib sqlite3 only, branch-root-relative DB path, fail-loud validation.
DB path gitignored (private decision data). 26 tests, seedgo 29/29.
Fresh start, no migration. Navigator burial + public-ize deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 02:49:57 -07:00
AIOSAIandClaude Opus 4.8 16848daf54 docs(prompts): complete agent list in global, trim+restyle devpulse local, smooth culture doc
Add @skills/@daemon/@commons/@backup to global prompt agent list; trim+restyle
devpulse local prompt to PROMPT_STYLE (single # headers, no emphasis, de-dup vs
global); smooth .claude culture doc (kill repeats, drop mechanical overlap).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 02:49:45 -07:00
AIOSAIandClaude Opus 4.8 b3e1e46b54 fix(ai_mail): dispatch_monitor — strip monitor framing lines from rate-limit scan
A PID containing "429" (e.g. 14290) in the monitor's own header line was
substring-matched as an HTTP 429, mislabeling sandbox-abort (-4) bounces as
"API rate limit" and flaking test_sandbox_failure_sends_bounce in push CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 00:09:30 -07:00