feat(anti-debt): technical-debt governance agent (V1+V1.2+KG), hardened - #6
Merged
Conversation
Ignore KG SQLite db, alert logs, periodic-scan reports and Rust test-fixture build output so they are never committed as part of the anti-debt subsystem.
…rdened Adds a portable, LLM-agnostic technical-debt governance agent under stack/agents/anti-debt/: deterministic scanners (code/security/deps/architecture), a Critic Engine with confidence tiers, a SQLite Knowledge Graph, governance skills, adapters and a CI workflow. Hardening applied after two review passes: - Stable finding identity: deterministic fingerprint replaces random UUIDs across all 6 scanners -> dedup, KG and history actually work across scans. - Schema<->scanner contract enforced: extended evidence.type/source/effort enums; new test validates REAL scanner output against the schema in CI. - Triage/plan split (Option B): build_triage + debt-triage.schema.json (deterministic) vs debt-plan.schema.json (LLM judgment), gated by validate_plan.py. - Critic reconciled to the documented 0.6 reject floor (code+docs+tests). - Calibration loop made functional; KG location unified; salt-free hashing for cross-process idempotency in kg_migrate. - scan_architecture cycle detection fixed for nested packages; scan_periodic and mvp_runtime scan all categories; prevention emits valid rules + real tests. - Removed dead code, fixed annotations, MiniMax CJK leaks, severity sort. Full suite: 9 test files green (incl. new schema-conformance guard).
GitHub Actions only executes workflows under the repository-root .github/workflows/. The anti-debt workflow lived under stack/agents/anti-debt/.github/workflows/ and therefore never ran — the test suite was green only locally. Move it to the root (its paths filter already scopes it to stack/agents/anti-debt/**) and fix a YAML error in a step name (unquoted colon) that the nested location had hidden.
Running the agent's own static analyzer on itself flagged the worst offenders. Reduce cyclomatic complexity by extracting helpers — behaviour unchanged, full suite green: - critic_v2.main: dispatcher table + per-command functions (CC 21 -> 3) - scan_code.heuristic_python_scan: split into _scan_secrets / _scan_ast_smells / _scan_dead_imports (CC 26 -> ~5); main split into _augment_python / _augment_polyglot (CC 17 -> 6) - kg_migrate.migrate_v1_to_v2: split into _process_scan/_history/_plan_file (CC 25 -> ~6) Functions with CC>=20 dropped from 5 to 2; the remaining two (detect_js_cycles, analyze_file) are sequential parsers/AST walkers — documented exceptions.
Activating CI surfaced that test_layer12/test_layer47/test_adapters hardcoded a Windows absolute path (D:\App\...), so they errored on the Linux runner while passing locally. Replace with a path derived from __file__. Also add the missing test-adapters job so the whole suite runs in CI.
Rwanbt
force-pushed
the
feat/anti-debt-hardening
branch
from
June 18, 2026 19:48
a1b0464 to
6025f80
Compare
This was referenced Jun 19, 2026
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.
Summary
Lands the anti-debt governance agent under
stack/agents/anti-debt/(deterministic scanners, Critic Engine, SQLite Knowledge Graph, governance skills, adapters, CI), with all fixes from two review passes applied.This is a new self-contained subsystem (~7k LOC) — large by line count, but it adds no diff to existing code. Full test suite is green at HEAD.
Hardening applied (review → fix)
evidence.type/source/estimated_effortenums; newtest_schema_conformancevalidates real scanner output (88+ findings) against the schema in CI.build_triage+debt-triage.schema.json(deterministic) vsdebt-plan.schema.json(LLM judgment), gated byvalidate_plan.py.0.6reject floor (code + docs + tests).original_confidence); KG location unified;kg_migrateuses salt-free hashing for cross-process idempotency.scan_periodic/mvp_runtimescan all categories; prevention emits valid rules + real regression tests.Tests
9 test files green locally, incl. the new schema-conformance guard. CI workflow covers schemas, critic, KG, layers 1-7, scan quality, dashboard e2e, and (new) full-Python syntax + schema conformance.
Out of scope (left untracked, pre-existing)
AGENTS.md(modified),hooks/,scripts/,routing-guide.md— not part of this audit.