Repository navigation
feat: cogos-reflect — agent-run reflection over session history - #33
Merged
Merged
Conversation
added 6 commits
November 10, 2026 12:36
Seven agent-centric skills (reflect, gather-history, find-friction, propose-fixes, review-proposals, curate-skills, session-retro) sharing one run dir and one append-only ledger. Stdlib scripts mine Claude Code, Codex, Hermes and the CogOS observatory into a redacted evidence bundle; the model reads only that. Synthesized from first-party /insights, /fewer-permission-prompts, claude-md-management, hookify, session-report, receipts, skill-creator and community second-nature, retro, agent-rsi, claudeception, claude-config-audit, mentor. 19 unit tests; trigger evals 20/20 on Sonnet. First real run: 2,580 sessions / 30d on Eclipse in ~13s.
a2b20e7) - content_words redacts before tokenizing, so cluster keys and ledger titles carry no secrets - bash_shape drops lowercase env assignments; shapes and families are redacted; cwd is home-relative - reflect_recur redacts the matched line it prints - input capped before regexes; bracket scans bounded (no O(n^2) on huge turns) - --run ids validated; reflect_skills/render can't write or read outside the runs dir - ledger fold skips malformed rows instead of crashing every reader - $R defined in every skill; find-friction reads error_signatures - marketplace.json: pure 5-line addition (revert escape churn) Tests 19 -> 26, end-to-end secret/home-path leak, per-adapter dedupe, backtracking, path escape, append-only. tests/mutation_check.py: 6/6 guards caught when removed.
… persisted - ledger: title/reason/ref/source/evidence pass quote()/redact_path() (ledger is committed on CogOS) - bash_shape + norm_command drop attached short-flag values (mysql -pSECRET); redact covers -p/--password - tool family, skill names, Hermes channel quoted; skills.json paths/descriptions redacted - SEEN_CALLS reset per main() run; WSL scan switch read at call time - ledger fold tolerates non-numeric counts - cards print run-relative proposal paths - tests 26 -> 28: secrets in error text + incantations, Codex/Hermes dedupe, reentrancy, ledger redaction, bad counts; mutation_check 6 -> 15 guards
- bash_shape keeps positionals only for known subcommand tools (one level; two for gh/docker/...); any other positional is data and never enters a shape (echo hunter2 -> echo) - adapter exception text redacted; codex adapter guards unreadable files - skills.json name/state/created_by/last_used quoted - ledger ids validated (F-/L-<alnum>) - deterministic file order in claude-code and codex adapters
…8f8d - short tool-call ids (call_0) dedupe per lineage; long provider ids stay global - --project quoted in bundle.json - README: ledger stores state; verification is the review-proposals procedure - redact() input capped and keyword pattern bounded (no O(n^2) on one huge word) - tests 28 -> 29; mutation_check 15/15 CAUGHT
…e flagged literals)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new plugin, cogos-reflect: seven agent-centric skills an agent reaches for when the operator asks things like "how do we work?", "make this easier", "never do that again" or "clean up my skills".
reflectgather-historybundle.json(redacted evidence from Claude Code, Codex, Hermes, the CogOS observatory)find-frictionfindings.json(+ optionalreport.html)propose-fixesproposals/<slug>/{PROPOSAL,EVIDENCE}.md + change.diff(≤ 3, cheapest-mechanism ladder)review-proposalscurate-skillssession-retroAll seven share one append-only ledger (
reflect_ledger.py, the only writer). The ledger remembers denials and checks whether applied fixes worked.Synthesized from the full text of first-party
/insights,/fewer-permission-prompts,claude-md-management,hookify,session-report,receiptsandskill-creator, and of communitysecond-nature,retro,agent-rsi,claudeception,claude-config-auditandmentor. The README has the table of what was taken from each.Verified
pytest tests: 19 passed. Synthetic fixtures only, no network.evals/run_trigger_evals.py --model sonnet: 20/20. 15 prompts land on the right skill, and 5 off-topic prompts land on decoys rather than the suite. The first pass was 16/20; four descriptions were rewritten.