Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
777 commits
Select commit Hold shift + click to select a range
b764107
Merge pull request #918 from automagik-dev/fix/serve-agent-independence
namastex888 Mar 30, 2026
9698424
chore(version): bump to 4.260330.14 [skip ci]
github-actions[bot] Mar 30, 2026
430f96c
fix(tui): use attach script with clear to hide terminal probes (#919)
namastex888 Mar 30, 2026
d854f50
chore(version): bump to 4.260330.15 [skip ci]
github-actions[bot] Mar 30, 2026
ecb38a9
fix(tui): keep process alive until renderer destroyed
Mar 30, 2026
046174a
fix(tui): keep process alive until renderer destroyed (#920)
namastex888 Mar 30, 2026
76cf9c2
chore(version): bump to 4.260330.16 [skip ci]
github-actions[bot] Mar 30, 2026
379b25e
fix(tui): enable mouse + focus left nav pane by default
Mar 30, 2026
364c756
Merge pull request #921 from automagik-dev/fix/tui-mouse-focus
namastex888 Mar 30, 2026
6200b68
chore(version): bump to 4.260330.17 [skip ci]
github-actions[bot] Mar 30, 2026
f481755
fix(tui): hide agent server status bar in nested attach
Mar 30, 2026
81d27e3
Merge pull request #922 from automagik-dev/fix/tui-status-bar-and-spawn
namastex888 Mar 30, 2026
b7e6c1a
chore(version): bump to 4.260330.18 [skip ci]
github-actions[bot] Mar 30, 2026
c353b53
fix: genie work/spawn launched TUI due to GENIE_TUI_PANE env leak
Mar 30, 2026
9621456
fix(cli): prevent GENIE_TUI_PANE env leak to child processes
Mar 30, 2026
6a4d413
Merge pull request #923 from automagik-dev/fix/tui-env-leak
namastex888 Mar 30, 2026
bcefdb9
chore(version): bump to 4.260330.19 [skip ci]
github-actions[bot] Mar 30, 2026
d89bf6b
fix(tui): stop creating empty agent sessions, spawn on Enter (#924)
namastex888 Mar 30, 2026
c57e399
chore(version): bump to 4.260330.20 [skip ci]
github-actions[bot] Mar 30, 2026
79286c7
chore: update live metrics (5/day, 0.3h avg, 84% SHIP)
claude Mar 30, 2026
d27d773
chore(version): bump to 4.260330.21 [skip ci]
github-actions[bot] Mar 30, 2026
45053fa
fix(tui): bidirectional Tab, Ctrl+Q detaches, remove broken Ctrl+T (#…
namastex888 Mar 30, 2026
69df49b
chore(version): bump to 4.260330.22 [skip ci]
github-actions[bot] Mar 30, 2026
94c6c81
fix(tui): restore default tmux server, fix agent CWD, add pane survival
Mar 30, 2026
95edf78
Merge pull request #926 from automagik-dev/fix-tui
namastex888 Mar 30, 2026
04bd7a2
chore(version): bump to 4.260330.23 [skip ci]
github-actions[bot] Mar 30, 2026
a3c8ab4
fix(tui): restore working TUI from 9a55ac32 + targeted fixes (#927)
namastex888 Mar 30, 2026
79420b3
chore(version): bump to 4.260330.24 [skip ci]
github-actions[bot] Mar 30, 2026
b3cdadf
fix(app): make Tauri sidecar self-contained by owning pgserve directly
namastex888 Mar 30, 2026
6022fff
chore(version): bump to 4.260330.25 [skip ci]
github-actions[bot] Mar 30, 2026
67b24ae
chore(wish): rewrite fix-tmux-session-explosion — default to repo age…
Mar 30, 2026
07ce8c0
chore(version): bump to 4.260330.26 [skip ci]
github-actions[bot] Mar 30, 2026
fe4b560
feat(tmux): add resolveRepoSession() and always store tmuxSessionName
Mar 30, 2026
3b2cad4
feat(tmux): wire resolveRepoSession into spawn paths + add --tmux-ses…
Mar 30, 2026
746ffdc
feat(team): add genie team cleanup command to kill windows for done t…
Mar 30, 2026
66ba0e6
feat(wish): unique-leader-names — kill generic team-lead naming
Mar 31, 2026
aabeb39
chore(version): bump to 4.260331.1 [skip ci]
github-actions[bot] Mar 31, 2026
7c56e45
chore: update live metrics (5/day, 0.3h avg, 85% SHIP)
claude Mar 31, 2026
0227957
chore(version): bump to 4.260331.2 [skip ci]
github-actions[bot] Mar 31, 2026
7f7cf09
fix(tmux): default team windows to repo agent session (#928)
namastex888 Mar 31, 2026
9b4e579
chore(version): bump to 4.260331.3 [skip ci]
github-actions[bot] Mar 31, 2026
85bc6f3
feat(wish): rewrite unique-leader-names — automatic context resolution
Mar 31, 2026
71b180b
chore(version): bump to 4.260331.4 [skip ci]
github-actions[bot] Mar 31, 2026
bf2a52f
feat(wish): add wish resolution and leader identity tracking
Mar 31, 2026
cb2747b
chore(wish): un-export internal interfaces to satisfy knip
Mar 31, 2026
178d167
feat(wish): wire genie work to wish-resolve and dynamic leadAgentId
Mar 31, 2026
81c6016
fix(lint): use optional chain instead of non-null assertion
Mar 31, 2026
15fb972
refactor(native-teams): extract scanTeamInbox to reduce complexity
Mar 31, 2026
a650570
feat(msg): dynamic leader routing in all messaging paths
Mar 31, 2026
a67724f
fix(msg): resolve lint warnings in messaging paths
Mar 31, 2026
3a3c96b
feat(wish): add wish-sync filesystem to PG indexing
Mar 31, 2026
ad679d8
feat(leader): backward compat cleanup — dynamic leader in all paths
Mar 31, 2026
d0ff218
refactor: extract helpers to reduce complexity in leader resolution
Mar 31, 2026
d22493f
Merge pull request #929 from automagik-dev/unique-leader-names
namastex888 Mar 31, 2026
c83843f
chore(version): bump to 4.260331.5 [skip ci]
github-actions[bot] Mar 31, 2026
eb2c522
feat(cli): wire agent namespace + auto-router skill rewrite
Mar 31, 2026
8c97c99
fix(cli): address PR review — argv slice + agent.error()
Mar 31, 2026
4604f1b
Merge pull request #930 from automagik-dev/genie-auto-router
namastex888 Mar 31, 2026
d168147
chore(version): bump to 4.260331.6 [skip ci]
github-actions[bot] Mar 31, 2026
8a537dd
refactor: rip out app_store item registry — belongs in genie-os
Mar 31, 2026
1daadf6
Merge pull request #932 from automagik-dev/unique-leader-names
namastex888 Mar 31, 2026
a4b774d
chore(version): bump to 4.260331.7 [skip ci]
github-actions[bot] Mar 31, 2026
7095edb
fix(team): resolve leader from project's leader_agent, not wish slug
Mar 31, 2026
60f2cd2
Merge pull request #933 from automagik-dev/fix/leader-from-project
namastex888 Mar 31, 2026
60f0eff
chore(version): bump to 4.260331.8 [skip ci]
github-actions[bot] Mar 31, 2026
f04db76
chore: remove 20 duplicate agent .md files
Mar 31, 2026
1b867b3
chore: mark 3 wishes SHIPPED (unique-leader-names, tmux-fix, task-ext…
Mar 31, 2026
3956a0b
chore(version): bump to 4.260331.9 [skip ci]
github-actions[bot] Mar 31, 2026
0edf0e1
Merge pull request #935 from automagik-dev/chore/remove-duplicate-age…
namastex888 Mar 31, 2026
f1919ee
chore(version): bump to 4.260331.10 [skip ci]
github-actions[bot] Mar 31, 2026
9bf2f05
feat(council): rewrite SKILL.md with real multi-agent deliberation pr…
Mar 31, 2026
3573f50
feat(council): update member definitions + add supporting files
Mar 31, 2026
f4675cf
fix(team): use team-lead template for leader spawn, wish slug for ide…
Mar 31, 2026
ab28fce
chore(version): bump to 4.260331.11 [skip ci]
github-actions[bot] Mar 31, 2026
d7a04c6
fix(team): leader name = team name, not project agent name
Mar 31, 2026
2fb72ee
chore(version): bump to 4.260331.12 [skip ci]
github-actions[bot] Mar 31, 2026
bd19d3f
test(db): add unit tests for db-backup module
Mar 31, 2026
a0f5cac
Merge pull request #937 from automagik-dev/db-backup-v3
namastex888 Mar 31, 2026
e9cd0c0
fix(tests): resolve flaky hook dispatch timeouts and otel port collision
Mar 31, 2026
8d76b05
chore(version): bump to 4.260331.13 [skip ci]
github-actions[bot] Mar 31, 2026
2587cd6
Merge pull request #938 from automagik-dev/fix/leader-name-and-test-t…
namastex888 Mar 31, 2026
dc60dfe
fix(council): remove residual voting language from questioner related…
Mar 31, 2026
382a7e4
fix(team): use team-lead template for leader spawn, wish slug for ide…
Mar 31, 2026
8b411ff
fix(team): leader name = team name, not project agent name
Mar 31, 2026
9dd931a
refactor(council): replace dispatch script with agentic orchestration
Mar 31, 2026
a592173
chore(version): bump to 4.260331.14 [skip ci]
github-actions[bot] Mar 31, 2026
fdbed67
Merge pull request #936 from automagik-dev/council-rework
namastex888 Mar 31, 2026
1c18bf6
chore(version): bump to 4.260331.15 [skip ci]
github-actions[bot] Mar 31, 2026
0353644
feat(dir): recursive sub-agent discovery in .genie/agents/
Mar 31, 2026
2523ad7
fix: auto-download tmux binary when not installed
vasconceloscezar Mar 31, 2026
57dc4a7
fix(test): handle PG ECONNREFUSED in setupTestSchema under concurrent…
Mar 31, 2026
1f0b4f2
fix(test): skip PG tests when schema setup fails under concurrent load
Mar 31, 2026
11d360b
Merge pull request #939 from automagik-dev/fix/auto-provision-tmux
namastex888 Mar 31, 2026
27c86f0
chore(version): bump to 4.260331.16 [skip ci]
github-actions[bot] Mar 31, 2026
002d1d4
fix(test): eliminate PG test flakiness — skip migrations in test conn…
Mar 31, 2026
e1f16eb
fix(review): address PR #940 feedback — scope sub-agent names, fix te…
Mar 31, 2026
b4ed145
feat: auto-download tmux at install time (postinstall + smart-install)
vasconceloscezar Mar 31, 2026
0dafcab
Merge pull request #940 from automagik-dev/feat/recursive-agent-sync
namastex888 Mar 31, 2026
ccc701d
chore(version): bump to 4.260331.17 [skip ci]
github-actions[bot] Mar 31, 2026
cba646b
fix: address review — await race, shell injection, plugin build
vasconceloscezar Mar 31, 2026
7425ef8
Merge pull request #941 from automagik-dev/feat/tmux-postinstall
namastex888 Mar 31, 2026
3d1704d
chore(version): bump to 4.260331.18 [skip ci]
github-actions[bot] Mar 31, 2026
5838dc9
feat(tui): quit confirmation popup + swap Ctrl+Q/Ctrl+D (#931)
filipexyz Mar 31, 2026
e87365a
Fix init bootstrap and first-agent TUI auto-open (#942)
filipexyz Mar 31, 2026
b9e2539
chore(version): bump to 4.260331.19 [skip ci]
github-actions[bot] Mar 31, 2026
ad4093d
fix: preserve tui quit binding
filipexyz Mar 31, 2026
1c95ccb
Merge pull request #943 from automagik-dev/codex/tui-quit-binding
namastex888 Mar 31, 2026
9d5c503
feat(tui): recursive sub-agent scanning in workspace tree
Mar 31, 2026
d9e7ce9
feat: global workspace + agent auto-spawn + collapsible agent tree
Mar 31, 2026
1e65f6a
chore: move rlmx.yaml into .rlmx/ directory
Mar 31, 2026
5252baa
chore(version): bump to 4.260331.20 [skip ci]
github-actions[bot] Mar 31, 2026
06b7df0
fix(test): remove app_store test — table dropped in migration 018
Apr 1, 2026
f30334d
refactor: remove all app_store references from agent-directory
Apr 1, 2026
a2fce50
Merge pull request #944 from automagik-dev/feat/recursive-agent-sync
namastex888 Apr 1, 2026
0bcb971
fix(ci): bump bun to 1.3.11 — fixes loadGenieConfigSync export resolu…
Apr 1, 2026
9134d24
fix(ci): bump bun 1.3.11 + increase db-backup test timeouts
Apr 1, 2026
c7455d4
Merge pull request #945 from automagik-dev/fix/ci-bun-version
namastex888 Apr 1, 2026
f624fa3
chore(version): bump to 4.260401.1 [skip ci]
github-actions[bot] Apr 1, 2026
6d6de2d
fix(db): add retention policies, fix pool recovery, deterministic mig…
Apr 1, 2026
7559c95
wip: v4-database-layer#2
Apr 1, 2026
252beac
fix(security): eliminate SQL injection in import + db-backup
Apr 1, 2026
a1c6c6a
fix(lint): extract runRetention helper to reduce getConnection comple…
Apr 1, 2026
0ee4810
Merge pull request #954 from automagik-dev/v4-database-layer
namastex888 Apr 1, 2026
6e83ee9
chore(version): bump to 4.260401.2 [skip ci]
github-actions[bot] Apr 1, 2026
b623cf0
feat(directory): add metadata JSONB column + fix edit() persistence
Apr 1, 2026
1de13f2
feat(frontmatter): extract shared parser with Zod validation
Apr 1, 2026
7fc1c4d
feat(sync): wire frontmatter into agent sync + provider resolution chain
Apr 1, 2026
029a1d1
feat(dir): display all frontmatter fields in dir ls + integration tests
Apr 1, 2026
46ca5ea
fix(session): v4 stability — executor lifecycle + tmux race condition…
namastex888 Apr 1, 2026
7b57db0
fix(hooks): v4 stability — blocking handlers deny on crash + slug val…
namastex888 Apr 1, 2026
6c6af9d
fix(spawn): v4 stability — spawn watchdog + dynamic leader identity (…
namastex888 Apr 1, 2026
b830de1
feat(skills): add behavioral quality patterns to brainstorm and work
Apr 1, 2026
1efee3a
fix(team): remove duplicate kickoff prompt — was sent via CLI arg AND…
Apr 1, 2026
01fd156
fix(engineer): gate genie done on success status + complete done_repo…
Apr 1, 2026
7463fed
Merge pull request #960 from automagik-dev/skill-quality-uplift
namastex888 Apr 1, 2026
59ff1e4
Merge pull request #961 from automagik-dev/agent-identity-sync
namastex888 Apr 1, 2026
b2d1bbb
fix(team): v4 stability — safe worktree removal + transactional clean…
namastex888 Apr 1, 2026
5202e1c
fix(router): v4 stability — advisory locks for spawn guard (#963)
namastex888 Apr 1, 2026
2e1900e
test(init-bootstrap): fix test isolation for workspace detection
Apr 1, 2026
d3ecfee
Merge pull request #965 from automagik-dev/fix-test-regressions
namastex888 Apr 1, 2026
8c34673
fix(router): use _deps injection instead of mock.module to avoid test…
Apr 1, 2026
056ed43
fix(router): surface errors in inbox writes and resume context injection
Apr 1, 2026
a4c29fc
fix(router): use _deps injection in spawn tests to prevent mock leaking
Apr 1, 2026
9f5e4c0
chore: fix biome format errors in JSON files
Apr 1, 2026
c0836ef
chore: metrics-updater run 2026-04-01 (no fresh data)
claude Apr 1, 2026
0204a2a
fix(tui): quit dialog and agent spawn from TUI
Apr 1, 2026
4b7de1c
chore: fix missing newline in plugin package.json
Apr 1, 2026
3dca39a
fix(tui): reconcile stale executors before spawn on Enter
Apr 1, 2026
fbe8984
fix(tui): isPaneAlive returns true for non-existent panes on tmux 3.5+
Apr 1, 2026
6657589
fix(spawn): detect recycled tmux pane IDs in duplicate role guard
Apr 1, 2026
6d20d2e
Merge pull request #968 from automagik-dev/fix/tui-quit-and-spawn
namastex888 Apr 1, 2026
843b951
fix(hooks): skip auto-spawn for team-lead alias without PG lookup
automagik-genie Apr 1, 2026
213f858
fix(hooks): skip auto-spawn for team-lead alias without PG lookup
automagik-genie Apr 1, 2026
3f4ecc7
fix(test): mock tmux-wrapper instead of tmux.js to prevent module poi…
automagik-genie Apr 1, 2026
798811d
fix(test): mock tmux-wrapper instead of tmux.js to prevent module poi…
automagik-genie Apr 1, 2026
e90e3ce
chore: trigger CI
automagik-genie Apr 1, 2026
3ad88c6
chore: re-trigger CI after test fixes
automagik-genie Apr 1, 2026
380c799
Merge branch 'v4-message-routing' into dev
Apr 1, 2026
9492b0d
Merge branch 'main' into dev
automagik-genie Apr 1, 2026
07a84be
chore(version): bump to 4.260401.3 [skip ci]
github-actions[bot] Apr 1, 2026
36d5ed7
feat(tui): ctrl+T creates new claude window for selected agent
Apr 1, 2026
addba87
refactor(tui): ctrl+T spawns parallel worker via genie spawn
Apr 1, 2026
73f8429
Merge pull request #972 from automagik-dev/feat/tui-ctrl-t-new-window
namastex888 Apr 1, 2026
09b5431
chore(version): bump to 4.260401.4 [skip ci]
github-actions[bot] Apr 1, 2026
1480a54
fix(spawn): always set --permission-mode for native team workers
Apr 1, 2026
d3ad3d2
Merge pull request #973 from automagik-dev/fix/native-team-permission…
namastex888 Apr 1, 2026
3bfbd72
chore(version): bump to 4.260401.5 [skip ci]
github-actions[bot] Apr 1, 2026
5bb25fa
chore: trigger publish for v4.260401.5
automagik-genie Apr 1, 2026
6def368
chore(version): bump to 4.260401.6 [skip ci]
github-actions[bot] Apr 1, 2026
f861da2
fix(tui): clear stale right pane content on serve restart
Apr 2, 2026
aef5c4a
fix(tui): prevent TUI env leak causing double nav sidebar
Apr 2, 2026
04026bd
test(protocol-router): add QA tests for spawn failure logging and del…
Apr 2, 2026
e979ec6
test(tui): add workspace sub-agent nesting and orphan session tests
Apr 2, 2026
4a558d1
fix(agent-directory): resolve workspace agents shadowed by built-ins
Apr 2, 2026
f57d0bc
style: fix lint errors in edge-cases-stability test
Apr 2, 2026
fe39d1e
Merge pull request #974 from automagik-dev/fix/tui-right-pane-stale-c…
namastex888 Apr 2, 2026
7c1acc6
chore(version): bump to 4.260402.1 [skip ci]
github-actions[bot] Apr 2, 2026
b489790
fix(test): add missing getWorkspaceConfig to workspace mock modules
Apr 2, 2026
6d90b36
refactor(hooks): extract resolve-agent-name, fix log unfiltered scope
filipexyz Apr 2, 2026
badef10
feat(spawn): add --role, --new-window, --window flags
filipexyz Apr 2, 2026
9f7add8
feat(tui): context menu with per-node actions and pane rename support
filipexyz Apr 2, 2026
7d7970f
Merge pull request #975 from automagik-dev/v4-release-qa
namastex888 Apr 2, 2026
15b67f9
fix(test): replace mock.module with spyOn for workspace.js in init tests
Apr 2, 2026
6ee7bc6
chore(version): bump to 4.260402.2 [skip ci]
github-actions[bot] Apr 2, 2026
2a82f2e
fix(tui): sub-agent session matching + selection stability + env restore
Apr 2, 2026
6485307
Merge pull request #976 from automagik-dev/fix/tui-session-name-slash…
namastex888 Apr 2, 2026
6e9f163
chore(version): bump to 4.260402.3 [skip ci]
github-actions[bot] Apr 2, 2026
212f1e4
feat: genie brain wiring — command delegation, auto-brain hooks, pgve…
Apr 2, 2026
13a1bb3
fix: brain wiring review — add genie brain install, gate task hook
Apr 2, 2026
be29b87
Merge pull request #977 from automagik-dev/feat/brain-wiring
namastex888 Apr 2, 2026
9789098
chore(version): bump to 4.260402.4 [skip ci]
github-actions[bot] Apr 2, 2026
85e1cad
fix: brain install from GitHub repo instead of npm registry
Apr 2, 2026
c760d8c
fix: remove hardcoded 60s timeout from brain install (codex review)
Apr 2, 2026
d82f3fd
Merge pull request #978 from automagik-dev/fix/brain-github-install
namastex888 Apr 2, 2026
3e11c04
chore(version): bump to 4.260402.5 [skip ci]
github-actions[bot] Apr 2, 2026
3fd9bed
fix: add @automagik/genie-brain as build external (dynamic import, no…
Apr 2, 2026
3551654
Merge pull request #979 from automagik-dev/fix/build-brain-external
namastex888 Apr 2, 2026
d93d400
chore(version): bump to 4.260402.6 [skip ci]
github-actions[bot] Apr 2, 2026
dc5ff22
fix: genie brain install uses git clone (private repo support)
Apr 2, 2026
271ea53
fix: use gh repo clone instead of token-in-URL (P1 security + P2 unin…
Apr 2, 2026
0624792
Merge pull request #981 from automagik-dev/fix/brain-install-git-clone
namastex888 Apr 2, 2026
fe3d021
chore(version): bump to 4.260402.7 [skip ci]
github-actions[bot] Apr 2, 2026
45222d9
feat: new /brain skill — knowledge graph with confidence scoring
Apr 2, 2026
1d350ec
Merge pull request #982 from automagik-dev/feat/brain-skill-v2
namastex888 Apr 2, 2026
fcc4fca
chore(version): bump to 4.260402.8 [skip ci]
github-actions[bot] Apr 2, 2026
21fba62
chore: metrics-updater run 2026-04-02 — failed (no gh CLI)
claude Apr 2, 2026
5fe5c66
chore(version): bump to 4.260402.9 [skip ci]
github-actions[bot] Apr 2, 2026
388e9ca
fix: restore agent identity on resume + fix skills symlink depth
Apr 2, 2026
d52a6d5
Merge pull request #983 from automagik-dev/fix/agent-identity-and-ski…
namastex888 Apr 2, 2026
bdf2e88
chore: remove all OpenClaw references from codebase
Apr 2, 2026
53ac527
fix: resume prior CC sessions in 3 broken launch paths
Apr 2, 2026
8291544
fix: resume prior CC sessions in 3 broken launch paths
Apr 2, 2026
e1d15f4
Merge pull request #984 from automagik-dev/chore/remove-openclaw
namastex888 Apr 2, 2026
5c82725
chore(version): bump to 4.260402.10 [skip ci]
github-actions[bot] Apr 2, 2026
9caf4e4
feat(tui): add system stats panel to left menu bottom
Apr 2, 2026
389a942
fix(tui): rename context menu labels — Start and Clone
Apr 2, 2026
44a153a
feat(mailbox): wire PG LISTEN/NOTIFY for instant message delivery
Apr 2, 2026
c6d0b3a
Merge pull request #988 from automagik-dev/feat/tui-system-stats
namastex888 Apr 2, 2026
add681a
Merge pull request #987 from automagik-dev/fix/session-amnesia-remain…
namastex888 Apr 2, 2026
8279c2e
Merge pull request #989 from automagik-dev/fix/tui-start-and-listen-n…
namastex888 Apr 2, 2026
be2b48b
chore(version): bump to 4.260402.11 [skip ci]
github-actions[bot] Apr 2, 2026
8e7c4b8
fix(tui): rewrite system stats with systeminformation for accurate hw…
Apr 2, 2026
0270cf7
Merge pull request #990 from automagik-dev/feat/tui-system-stats-v2
namastex888 Apr 2, 2026
047a458
chore(version): bump to 4.260402.12 [skip ci]
github-actions[bot] Apr 2, 2026
99b96a0
fix(security): sanitize column names in import prepareRow()
Apr 2, 2026
2d6845e
fix(tui): v3 system stats — fix garbled rendering and wrong metrics
Apr 2, 2026
604b26f
refactor: unify serve + daemon under single process ownership
Apr 2, 2026
69e1cee
Merge pull request #991 from automagik-dev/refactor/unify-serve-daemon
namastex888 Apr 2, 2026
381c1c3
Merge pull request #992 from automagik-dev/fix/import-column-sanitiza…
namastex888 Apr 2, 2026
14f617b
Merge pull request #993 from automagik-dev/fix/tui-system-stats-v3
namastex888 Apr 2, 2026
11dff85
chore(version): bump to 4.260402.13 [skip ci]
github-actions[bot] Apr 2, 2026
ed92568
fix: auto-resume Claude session on genie spawn instead of creating new
Apr 2, 2026
bfea41e
refactor: extract findDeadResumable helper to reduce cognitive comple…
Apr 2, 2026
83fafb9
fix: use optional chain instead of non-null assertion for claudeSessi…
Apr 2, 2026
4f7b357
Merge pull request #994 from automagik-dev/fix/spawn-auto-resume
namastex888 Apr 2, 2026
9945108
chore(version): bump to 4.260402.14 [skip ci]
github-actions[bot] Apr 2, 2026
419e4b1
fix(task): resolve JSON truncation at 8KB + honor --project with --all
Apr 2, 2026
22aa551
fix(tmux): enable OSC 52 clipboard passthrough in nested tmux layers
Apr 2, 2026
1007c0d
Merge pull request #996 from automagik-dev/fix/tmux-osc52-clipboard
namastex888 Apr 2, 2026
28bcc46
chore(version): bump to 4.260402.15 [skip ci]
github-actions[bot] Apr 2, 2026
0207566
docs: update /brain skill to cover full genie-brain v0.1.0 API
Apr 2, 2026
139dcaf
Merge pull request #997 from automagik-dev/docs/update-brain-skill
namastex888 Apr 2, 2026
88431fa
chore(version): bump to 4.260402.16 [skip ci]
github-actions[bot] Apr 2, 2026
492be5d
Merge pull request #995 from automagik-dev/fix/task-list-json-truncat…
namastex888 Apr 2, 2026
a212db4
chore(version): bump to 4.260402.17 [skip ci]
github-actions[bot] Apr 2, 2026
7c21301
fix: ensure teammateMode=bypassPermissions on native team setup
Apr 2, 2026
795636a
Merge pull request #998 from automagik-dev/fix/ensure-teammate-bypass…
namastex888 Apr 2, 2026
b597c87
chore(version): bump to 4.260402.18 [skip ci]
github-actions[bot] Apr 2, 2026
6f18de8
fix: preserve model field on agent resume
automagik-genie Apr 2, 2026
49d5027
Merge pull request #1000 from automagik-dev/fix/resume-model-field
namastex888 Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"plugins": [
{
"name": "genie",
"version": "3.260322.1",
"version": "4.260402.18",
"source": "./plugins/genie",
"description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, wish them into plans, make with parallel agents, ship as one team. A coding genie that grows with your project."
}
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/level-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Silently scan the user's environment. Do NOT ask permission for each check. Just
- Cron jobs, launchd services, or systemd services calling Claude on a schedule?
- Background agents running 24/7 (pm2, systemd)?
- Autonomous loop scripts (PRD + test suite patterns)?
- Agent orchestration configs (Agent Teams, Gastown, OpenClaw)?
- Agent orchestration configs (Agent Teams, Gastown)?
- Evidence of agents managing other agents?
```

Expand Down Expand Up @@ -541,7 +541,7 @@ Show ONLY the next level transition. Do not dump all 10 levels. Focus is everyth
- Agents talk to each other through shared files. One agent writes a task list, another picks up items, does the work, and marks them done. They coordinate through your project folder and git branches, like coworkers using a shared task board.

4. **Always-on assistants**
- OpenClaw: an open source framework that runs Claude as a persistent assistant you can message via WhatsApp or Telegram. You text it like a colleague. It's always available, always has your context.
- Persistent agent frameworks that run Claude as an always-available assistant you can message via WhatsApp or Telegram. You text it like a colleague. It's always available, always has your context.

**Community tip:** Level 10 is experimental. The community is actively building and testing these patterns. Things break. The value is in the learning. Very few people are here, and those who are spend significant time managing the systems. This is not "set and forget." This is "build, monitor, iterate."

Expand Down
44 changes: 44 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,50 @@
"timeout": 5
}
]
},
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "genie hook dispatch",
"timeout": 5
}
]
}
],
"PostToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "genie hook dispatch",
"timeout": 5
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "genie hook dispatch",
"timeout": 5
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "genie hook dispatch",
"timeout": 5
}
]
}
]
}
Expand Down
29 changes: 29 additions & 0 deletions .genie/agents/metrics-updater/AGENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# metrics-updater Agent

Fetches live GitHub metrics daily and updates the README metrics table.

## Metrics Collected

- **Releases/day** — releases published in the last 24h
- **Avg merge time** — mean lead time (created→merged) for PRs closed in last 7d
- **SHIP rate** — merged / total closed PRs in last 7d (%)
- **Merged PRs (7d)** — count of merged PRs in the rolling 7-day window

## README Markers

The agent updates the block between `<!-- METRICS:START -->` and `<!-- METRICS:END -->` in README.md.

If markers are missing, insert the table after the badges block, before `## What is Genie?`.

## Commit Convention

```
chore: update live metrics (X/day, Yh avg, Z% SHIP)
```

Push to `dev` branch only. Never push to `main`.

## State Files

- `state.json` — last successful metrics run
- `runs.jsonl` — append-only log of every run
17 changes: 17 additions & 0 deletions .genie/agents/metrics-updater/runs.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{"timestamp":"2026-03-24T22:44:08Z","duration_ms":4685,"api_calls":2,"tools_generated":0,"tools_available":5,"errors":[],"status":"success","fallback":false,"slowest_step":"unknown","steps":[],"metrics":{"releases_per_day":0,"avg_bugfix_time_hours":2.0,"ship_rate_pct":100.0,"parallel_agents":3,"updated":"2026-03-24"}}
{"timestamp": "2026-03-24T22:54:18Z", "duration_ms": 4579, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "success", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 31}, {"name": "fetch_releases", "duration_ms": 3023}, {"name": "fetch_prs", "duration_ms": 1218}, {"name": "count_agents", "duration_ms": 65}, {"name": "parse_metrics", "duration_ms": 126}, {"name": "update_readme", "duration_ms": 51}, {"name": "update_state", "duration_ms": 35}, {"name": "commit", "duration_ms": 4}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:05Z", "duration_ms": 4292, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "success", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 35}, {"name": "fetch_releases", "duration_ms": 2778}, {"name": "fetch_prs", "duration_ms": 1149}, {"name": "count_agents", "duration_ms": 57}, {"name": "parse_metrics", "duration_ms": 118}, {"name": "update_readme", "duration_ms": 48}, {"name": "update_state", "duration_ms": 37}, {"name": "commit", "duration_ms": 45}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:11Z", "duration_ms": 3833, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "no_changes", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 31}, {"name": "fetch_releases", "duration_ms": 2640}, {"name": "fetch_prs", "duration_ms": 872}, {"name": "count_agents", "duration_ms": 53}, {"name": "parse_metrics", "duration_ms": 124}, {"name": "update_readme", "duration_ms": 47}, {"name": "update_state", "duration_ms": 39}, {"name": "commit", "duration_ms": 3}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:17Z", "duration_ms": 4637, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "no_changes", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 31}, {"name": "fetch_releases", "duration_ms": 3344}, {"name": "fetch_prs", "duration_ms": 980}, {"name": "count_agents", "duration_ms": 54}, {"name": "parse_metrics", "duration_ms": 122}, {"name": "update_readme", "duration_ms": 45}, {"name": "update_state", "duration_ms": 33}, {"name": "commit", "duration_ms": 3}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:24Z", "duration_ms": 4067, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "no_changes", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 37}, {"name": "fetch_releases", "duration_ms": 2732}, {"name": "fetch_prs", "duration_ms": 1008}, {"name": "count_agents", "duration_ms": 55}, {"name": "parse_metrics", "duration_ms": 123}, {"name": "update_readme", "duration_ms": 45}, {"name": "update_state", "duration_ms": 38}, {"name": "commit", "duration_ms": 3}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:30Z", "duration_ms": 4728, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "no_changes", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 31}, {"name": "fetch_releases", "duration_ms": 3211}, {"name": "fetch_prs", "duration_ms": 1186}, {"name": "count_agents", "duration_ms": 59}, {"name": "parse_metrics", "duration_ms": 126}, {"name": "update_readme", "duration_ms": 52}, {"name": "update_state", "duration_ms": 34}, {"name": "commit", "duration_ms": 3}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:37Z", "duration_ms": 4374, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "no_changes", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 34}, {"name": "fetch_releases", "duration_ms": 2985}, {"name": "fetch_prs", "duration_ms": 1063}, {"name": "count_agents", "duration_ms": 53}, {"name": "parse_metrics", "duration_ms": 131}, {"name": "update_readme", "duration_ms": 47}, {"name": "update_state", "duration_ms": 34}, {"name": "commit", "duration_ms": 3}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-24T22:57:43Z", "duration_ms": 4201, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "no_changes", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 32}, {"name": "fetch_releases", "duration_ms": 2704}, {"name": "fetch_prs", "duration_ms": 1172}, {"name": "count_agents", "duration_ms": 65}, {"name": "parse_metrics", "duration_ms": 122}, {"name": "update_readme", "duration_ms": 43}, {"name": "update_state", "duration_ms": 35}, {"name": "commit", "duration_ms": 3}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.9, "ship_rate_pct": 100.0, "parallel_agents": 3, "updated": "2026-03-24"}}
{"timestamp": "2026-03-25T00:03:05Z", "duration_ms": 5882, "api_calls": 2, "tools_generated": 0, "tools_available": 10, "errors": [], "status": "success", "fallback": false, "slowest_step": "fetch_releases", "steps": [{"name": "load_state", "duration_ms": 33}, {"name": "fetch_releases", "duration_ms": 3458}, {"name": "fetch_prs", "duration_ms": 1046}, {"name": "count_agents", "duration_ms": 53}, {"name": "parse_metrics", "duration_ms": 1191}, {"name": "update_readme", "duration_ms": 45}, {"name": "update_state", "duration_ms": 30}, {"name": "commit", "duration_ms": 4}], "metrics": {"releases_per_day": 0, "avg_bugfix_time_hours": 1.7, "ship_rate_pct": 100.0, "loc_changed_24h": 7418, "commits_24h": 66, "prs_24h": 28, "parallel_agents": 3, "updated": "2026-03-25T00:03:04Z"}}
{"timestamp":"2026-03-25T00:00:00Z","duration_ms":31579683120,"api_calls":3,"tools_generated":1,"errors":0,"metrics":{"releases_24h":0,"avg_merge_time_hours":0.7,"ship_rate_pct":96,"merged_prs_7d":48}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The duration_ms value 31579683120 on this line is approximately 365 days. This seems to be an error, possibly from a bug in the duration calculation or a placeholder value. Such an extreme outlier can corrupt performance analysis and metrics.

{"timestamp":"2026-03-28T00:00:00Z","duration_ms":45000,"api_calls":3,"tools_generated":0,"errors":[],"metrics":{"releases_24h":0,"avg_merge_time_hours":2.9,"ship_rate_pct":94,"merged_prs_7d":47}}
{"timestamp":"2026-03-29T00:00:00Z","duration_ms":52000,"api_calls":2,"tools_generated":0,"errors":[],"metrics":{"releases_24h":0,"avg_merge_time_hours":3.0,"ship_rate_pct":92,"merged_prs_7d":46}}
{"timestamp":"2026-03-30T00:00:00Z","duration_ms":5000,"api_calls":3,"tools_generated":0,"errors":0,"metrics":{"releases_24h":0,"releases_per_day":0,"avg_merge_time_hours":0.3,"ship_rate_pct":84,"merged_prs_7d":32,"closed_prs_7d":38}}
{"timestamp":"2026-03-31T00:00:00Z","duration_ms":5002,"api_calls":2,"tools_generated":4,"errors":0,"metrics":{"releases_24h":0,"merged_prs_7d":35,"avg_merge_time_h":0.3,"ship_rate_pct":85}}
{"timestamp":"2026-04-01T00:00:00Z","duration_ms":8000,"api_calls":0,"tools_generated":0,"errors":["gh CLI unavailable","GitHub MCP tools not loaded in session"],"status":"failed","fallback":false,"metrics":null}
{"timestamp":"2026-04-02T00:00:00.000Z","duration_ms":15000,"api_calls":0,"tools_generated":0,"errors":["gh CLI not available","GitHub MCP tools not present in session"],"status":"failed","fallback":false,"metrics":null}
10 changes: 10 additions & 0 deletions .genie/agents/metrics-updater/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"last_run": "2026-04-02T00:00:00.000Z",
"last_run_status": "failed",
"last_metrics": {
"releases_24h": 0,
"merged_prs_7d": 35,
"avg_merge_time_h": 0.3,
"ship_rate_pct": 85
}
}
38 changes: 38 additions & 0 deletions .genie/agents/metrics-updater/tools/batch-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# batch-commit.sh — Optimized commit for metrics updates
# Auto-generated by generate-tools.py
# Idempotent: safe to run multiple times, regenerate freely.
#
# Usage: bash batch-commit.sh <metrics.json> <repo-root> <state-file>
#
# Optimizations:
# - Single git add for all files
# - Pre-formatted commit message (no subshell)
# - Skip if working tree is clean

set -euo pipefail

METRICS_FILE="${1:?Usage: batch-commit.sh <metrics.json> <repo-root> <state-file>}"
REPO_ROOT="${2:?}"
STATE_FILE="${3:?}"

cd "$REPO_ROOT"

# Skip if no changes
if git diff --quiet HEAD -- README.md "$STATE_FILE" 2>/dev/null; then
echo "No changes to commit" >&2
exit 2
fi

# Read metrics for commit message
releases=$(python3 -c "import json; print(json.load(open('$METRICS_FILE')).get('releases_per_day', 0))")
avg_time=$(python3 -c "import json; print(json.load(open('$METRICS_FILE')).get('avg_bugfix_time_hours', 0))")
ship_rate=$(python3 -c "import json; print(json.load(open('$METRICS_FILE')).get('ship_rate_pct', 0))")
Comment on lines +28 to +30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This script invokes python3 three separate times to parse the same JSON file. This is inefficient and can be hard to maintain. It would be better to parse the JSON file once using a tool like jq, which is already used in other scripts in this agent, for better performance and consistency.

Suggested change
releases=$(python3 -c "import json; print(json.load(open('$METRICS_FILE')).get('releases_per_day', 0))")
avg_time=$(python3 -c "import json; print(json.load(open('$METRICS_FILE')).get('avg_bugfix_time_hours', 0))")
ship_rate=$(python3 -c "import json; print(json.load(open('$METRICS_FILE')).get('ship_rate_pct', 0))")
releases=$(jq -r '.releases_per_day // 0' "$METRICS_FILE")
avg_time=$(jq -r '.avg_bugfix_time_hours // 0' "$METRICS_FILE")
ship_rate=$(jq -r '.ship_rate_pct // 0' "$METRICS_FILE")


COMMIT_MSG="chore: update live metrics (${releases}/day, ${avg_time}h avg, ${ship_rate}% SHIP)"

# Single add + commit
git add README.md "$STATE_FILE"
git commit -m "$COMMIT_MSG"

echo "$COMMIT_MSG"
86 changes: 86 additions & 0 deletions .genie/agents/metrics-updater/tools/cached-fetch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
# cached-fetch.sh — Cached GitHub API fetcher with TTL
# Auto-generated by generate-tools.py
# Idempotent: safe to run multiple times, regenerate freely.
#
# Usage: source cached-fetch.sh; cached_gh_api <endpoint> [ttl_seconds]
# Default TTL: 1800s (30 minutes) — daily agent runs don't need real-time data

CACHE_DIR="${GENIE_METRICS_CACHE:-/tmp/metrics-updater-cache}"
DEFAULT_TTL="${GENIE_METRICS_CACHE_TTL:-1800}"

mkdir -p "$CACHE_DIR"

cached_gh_api() {
local endpoint="$1"
local ttl="${2:-$DEFAULT_TTL}"
local cache_key
cache_key=$(echo "$endpoint" | md5sum | cut -d' ' -f1)
local cache_file="$CACHE_DIR/${cache_key}.json"
local meta_file="$CACHE_DIR/${cache_key}.meta"

# Check cache validity
if [[ -f "$cache_file" && -f "$meta_file" ]]; then
local cached_at
cached_at=$(cat "$meta_file" 2>/dev/null || echo 0)
local now
now=$(date +%s)
local age=$((now - cached_at))

if (( age < ttl )); then
echo "[cache] HIT: $endpoint (age=${age}s, ttl=${ttl}s)" >&2
cat "$cache_file"
return 0
fi
echo "[cache] STALE: $endpoint (age=${age}s, ttl=${ttl}s)" >&2
else
echo "[cache] MISS: $endpoint" >&2
fi

# Fetch fresh data
local response
if response=$(gh api "$endpoint" --paginate 2>/dev/null); then
echo "$response" > "$cache_file"
date +%s > "$meta_file"
echo "$response"
return 0
fi

# Fallback to stale cache
if [[ -f "$cache_file" ]]; then
echo "[cache] FALLBACK: Using stale cache for $endpoint" >&2
cat "$cache_file"
return 0
fi

echo "[cache] FAIL: No data for $endpoint" >&2
return 1
}

# Warm cache for common endpoints (call at start of run)
warm_cache() {
local owner="${1:-automagik-dev}"
local repo="${2:-genie}"
echo "[cache] Warming cache for $owner/$repo..." >&2
cached_gh_api "repos/$owner/$repo/releases" >/dev/null 2>&1 &
cached_gh_api "repos/$owner/$repo/pulls?state=closed&sort=updated&direction=desc&per_page=100" >/dev/null 2>&1 &
wait
echo "[cache] Cache warmed" >&2
}

# Clear expired cache entries
clean_cache() {
local max_age="${1:-86400}" # Default: 24h
local now
now=$(date +%s)
for meta in "$CACHE_DIR"/*.meta; do
[[ -f "$meta" ]] || continue
local cached_at
cached_at=$(cat "$meta" 2>/dev/null || echo 0)
if (( now - cached_at > max_age )); then
local base="${meta%.meta}"
rm -f "$base.json" "$meta"
echo "[cache] Cleaned: $(basename "$base")" >&2
fi
done
}
27 changes: 27 additions & 0 deletions .genie/agents/metrics-updater/tools/commit-formatter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# commit-formatter.sh — Clean commit message formatter for metrics updates
# Auto-generated by metrics-updater agent (v1, 2026-03-24)
# Updated: v2 — includes LoC/commits/PRs in commit message

set -euo pipefail

# Usage: commit-formatter.sh <metrics_json_file>
# Reads metrics JSON and outputs a formatted commit message.

METRICS_FILE="${1:-}"

if [[ -z "$METRICS_FILE" || ! -f "$METRICS_FILE" ]]; then
echo "Usage: commit-formatter.sh <metrics.json>" >&2
exit 1
fi

# Extract values
releases=$(jq -r '.releases_per_day // 0' "$METRICS_FILE")
avg_time=$(jq -r '.avg_bugfix_time_hours // 0' "$METRICS_FILE")
ship_rate=$(jq -r '.ship_rate_pct // 0' "$METRICS_FILE")
loc=$(jq -r '.loc_changed_24h // 0' "$METRICS_FILE")
commits=$(jq -r '.commits_24h // 0' "$METRICS_FILE")
prs=$(jq -r '.prs_24h // 0' "$METRICS_FILE")

# Format commit message
echo "chore: update live metrics (${releases}/day, ${avg_time}h avg, ${ship_rate}% SHIP, ${loc} LoC, ${commits} commits, ${prs} PRs)"
92 changes: 92 additions & 0 deletions .genie/agents/metrics-updater/tools/fast-parse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/usr/bin/env python3
"""fast-parse.py — Optimized metrics parser with pre-compiled patterns.

Auto-generated by generate-tools.py.
Idempotent: safe to run multiple times, regenerate freely.

Differences from parse-metrics.py:
- Pre-compiled datetime parsing (avoids repeated fromisoformat)
- Batch processing (single pass over PR data)
- Early termination (stops counting when past cutoff)

Usage:
python3 fast-parse.py --releases <file> --prs <file> --agents <N> [-o output.json]
"""

import json
import sys
import argparse
from datetime import datetime, timedelta, timezone
from functools import lru_cache

NOW = datetime.now(timezone.utc)
CUTOFF_24H = NOW - timedelta(hours=24)
CUTOFF_7D = NOW - timedelta(days=7)


def parse_iso(s: str) -> datetime:
"""Fast ISO8601 parsing."""
return datetime.fromisoformat(s.replace('Z', '+00:00'))


def compute_all_metrics(releases: list, prs: list, parallel_agents: int) -> dict:
"""Single-pass computation of all metrics from raw API data."""
# Releases in last 24h
releases_24h = sum(1 for r in releases if parse_iso(r['created_at']) >= CUTOFF_24H)

# PR metrics in single pass
merge_durations = []
total_merged_7d = 0
shipped_first = 0

for pr in prs:
merged_at = pr.get('merged_at')
if not merged_at:
continue
merged = parse_iso(merged_at)
if merged < CUTOFF_7D:
continue # Past our window — skip

total_merged_7d += 1
created = parse_iso(pr['created_at'])
merge_durations.append((merged - created).total_seconds() / 3600)
shipped_first += 1 # v1: all merged = shipped

avg_merge = round(sum(merge_durations) / len(merge_durations), 1) if merge_durations else 0.0
ship_rate = round((shipped_first / total_merged_7d) * 100, 0) if total_merged_7d > 0 else 100.0

return {
'releases_per_day': releases_24h,
'avg_bugfix_time_hours': avg_merge,
'ship_rate_pct': ship_rate,
'parallel_agents': parallel_agents,
'updated': NOW.strftime('%Y-%m-%d'),
}


def main():
parser = argparse.ArgumentParser(description='Fast metrics parser')
parser.add_argument('--releases', required=True, help='Releases JSON file')
parser.add_argument('--prs', required=True, help='PRs JSON file')
parser.add_argument('--agents', type=int, default=0, help='Parallel agents count')
parser.add_argument('--output', '-o', help='Output file (default: stdout)')

args = parser.parse_args()

with open(args.releases) as f:
releases = json.load(f)
with open(args.prs) as f:
prs = json.load(f)

metrics = compute_all_metrics(releases, prs, args.agents)
output = json.dumps(metrics, indent=2)

if args.output:
with open(args.output, 'w') as f:
f.write(output + '\n')
else:
print(output)


if __name__ == '__main__':
main()
Loading
Loading