-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Feat/Add a durable SlopLedger that makes invisible architectural residue visible and queryable across agent sessions
#2161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6bc8363
feat: add SlopLedger for tracking unresolved architectural residue (#…
idling11 3cfb265
fix: resolve borrow-checker error in slop_ledger append tool
idling11 3e07399
fix: use read-only slop ledger tools in plan mode
idling11 d107433
chore: remove COMMIT_MSG.md from tracking
idling11 f700076
fix: suppress dead_code warnings for CI -Dwarnings
idling11 8928e1d
fix: address code review — error propagation, prefix match, atomic wr…
idling11 9c5bf7d
chore: remove COMMIT_MSG.md
idling11 9943fe5
feat: add export redaction + completion-gate verifier hook for SlopLe…
idling11 e902681
feat: integrate SlopLedger completion-gate into turn loop — auto-chec…
idling11 ff1a8cd
style: cargo fmt fix
idling11 a73da58
feat: inject SlopLedger gate into system prompt — agent sees open ent…
idling11 721a979
perf: cache SlopLedger gate in engine to avoid disk I/O on every turn…
idling11 b75a159
fix: harden slop ledger rescue paths
Hmbown 335e39a
Merge remote-tracking branch 'origin/main' into codex/pr2161-head-fix
Hmbown a9c0a4a
fix: cover slop command in Vietnamese locale
Hmbown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Commit Message — SlopLedger (#2127) | ||
|
|
||
| ## Summary | ||
|
|
||
| Add a durable `SlopLedger` that makes invisible architectural residue | ||
| visible and queryable across agent sessions. | ||
|
|
||
| Closes: https://github.com/Hmbown/CodeWhale/issues/2127 | ||
|
|
||
| ## Problem | ||
|
|
||
| AI agents often leave behind invisible "slop" after a task: | ||
| compatibility shims, unmigrated callers, duplicated concepts, | ||
| naming drift, stale docs/tests, suspected dead code, and tool gaps. | ||
|
|
||
| Currently these residues are untracked. The next agent rediscovers | ||
| them, amplifies them, or mistakes them for intended architecture. | ||
|
|
||
| ## Solution | ||
|
|
||
| A persistent JSON-backed ledger (`~/.codewhale/slop_ledger/slop_ledger.json`) | ||
| with four model-callable tools and a `/slop` slash command. | ||
|
|
||
| ### Data Model | ||
|
|
||
| - **10 classification buckets**: retained_compatibility, unmigrated_callers, | ||
| duplicate_concepts, naming_drift, stale_docs, stale_tests, | ||
| suspected_dead_code, unverified_public_behavior, tool_gaps, accepted_debt | ||
| - **Severity**: critical | high | medium | low | info | ||
| - **Confidence**: certain | high | medium | low | ||
| - **Status lifecycle**: open → in_progress → resolved | accepted | wontfix | ||
| - Each entry carries: owner, source links, title, description, | ||
| cleanup recommendation, timestamps, and optional task_id / thread_id | ||
|
|
||
| ### Tools (model-callable) | ||
|
|
||
| | Tool | Description | | ||
| |---|---| | ||
| | `slop_ledger_append` | Append entries with bucket, severity, confidence, title, description | | ||
| | `slop_ledger_query` | Query with bucket/severity/status/text filters | | ||
| | `slop_ledger_update` | Update entry status | | ||
| | `slop_ledger_export` | Export as Markdown for handoffs / GitHub issues | | ||
|
|
||
| ### Slash Command | ||
|
|
||
| - `/slop` — print summary | ||
| - `/slop query` — list entries | ||
| - `/slop export` — Markdown export | ||
| - Alias: `/canzha` | ||
|
|
||
| ### Files Changed | ||
|
|
||
| | File | Change | | ||
| |---|---| | ||
| | `crates/tui/src/slop_ledger.rs` | **New** — 1089 lines | | ||
| | `crates/tui/src/main.rs` | +1: mod declaration | | ||
| | `crates/tui/src/tools/registry.rs` | +16: builder method | | ||
| | `crates/tui/src/core/engine/tool_setup.rs` | +1: registration | | ||
| | `crates/tui/src/commands/mod.rs` | +10: command + dispatch | | ||
| | `crates/tui/src/commands/config.rs` | +41: handler | | ||
|
|
||
| ### Tests | ||
|
|
||
| 8 unit tests: bucket roundtrip, save/load, query by bucket/search, | ||
| update status, markdown export, empty ledger, summary counts. | ||
|
|
||
| ## How to Test | ||
|
|
||
| ```bash | ||
| cargo test -p codewhale-tui -- slop_ledger | ||
| ``` | ||
|
|
||
| In TUI: `/slop`, `/slop query`, `/slop export` |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slicing
&entry.id[..8]directly can panic if the ID is shorter than 8 bytes or sliced on an invalid UTF-8 boundary. Use.get(..8)to safely slice the ID.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Show id