CORE is a system I've been building for over a year. Its purpose is to govern and autonomously improve software codebases using constitutional rules—not loose AI reasoning, but deterministic policies enforced by auditors and workers in a layered architecture (Mind/Body/Will).
The self-improvement loop is straightforward:
AuditViolationSensor detects violation
→ posts finding to blackboard
→ ViolationRemediatorWorker creates proposal
→ ProposalConsumerWorker executes fix
→ AuditViolationSensor confirms resolved
For months, every proposal failed silently with the message: Actions failed: fix.logging. The autonomous pipeline—the core feature—was completely broken, and the failure left almost no useful trace.
The Investigation
The first red flag was that execution_results on every failed proposal was an empty dict {}. This meant the failure occurred before ActionExecutor even ran. Proposals were created correctly, approved correctly, and then died in the execution path.
Working backwards:
-
ProposalConsumerWorkerpicked up approved proposals. - It called
ProposalExecutor.execute(). -
ActionExecutor.execute("fix.logging")crashed with:AttributeError: 'NoneType' object has no attribute 'write_runtime_text'
write_runtime_text belongs to FileHandler, which meant file_handler was None.
I checked the daemon startup code in src/will/commands/daemon.py. It wired up git_service, knowledge_service, cognitive_service, and qdrant_service—but file_handler was never set. CoreContext defaults it to None.
The CLI path worked fine because the @core_command decorator wires the full CoreContext (including FileHandler). The daemon startup simply forgot it.
Root cause: one missing line. Months of silent failure.
The Fix That Got Rejected
The obvious patch looked like this:
# In src/will/commands/daemon.py
from shared.infrastructure.storage.file_handler import FileHandler
ctx.file_handler = FileHandler(str(BootstrapRegistry.get_repo_path()))
CORE's own audit immediately rejected it:
ERROR | architecture.boundary.file_handler_access
src/will/commands/daemon.py:199 — Forbidden import:
'from shared.infrastructure.storage.file_handler import FileHandler'
daemon.py lives in the Will layer. FileHandler lives in shared.infrastructure.storage—Body layer territory. The Will layer is not allowed to import Body infrastructure directly.
The system enforced its own architectural boundaries against its author.
The Correct Fix
Add get_file_handler() to ServiceRegistry (in the Body layer, where it belongs), then call it from the daemon:
# Proper approach
ctx.file_handler = service_registry.get_file_handler()
The import now lives where the constitution says it should.
What Happened Next
Once the pipeline started running, two more bugs surfaced:
Double
writeargument —ProposalExecutorpassedwrite=Trueexplicitly and unpacked{"write": True}from proposal parameters →TypeError: got multiple values for keyword argument 'write'.
Fixed by strippingwritefrom parameters before unpacking.Layer detection in LoggingFixer — The autonomous fixer converted
console.print()tologger.info()in CLI-layer files because its path detection only checked forbody/cli, missingsrc/cli/. It was breaking its own rendering.
Fixed by updating the path detection logic.
First Autonomous Completion
After the fixes:
status: completed
fixes_applied: 28
files_modified: 4
dry_run: False
No human approval. No human review. The governance pipeline ran end-to-end for the first time.
What This Revealed About Constitutional Governance
Three lessons stood out:
Silent failures are a design smell.
Thefix.loggingaction returnedActionResult(ok=True)unconditionally, regardless of outcome. The pipeline reported success even when it wasn't. Observability isn't optional—it's a constitutional requirement.Layer boundaries matter at runtime, not just during review.
The daemon missedfile_handlerbecause the bootstrap path (used by CLI) was never wired into the daemon path. Two code paths, one constitutional contract, and one path that didn't honour it.The governance system catching your own mistake is the point.
The audit rejection of the wrong-layer import wasn't an obstacle. It was the system working as designed. The constitution exists precisely for moments when you're moving fast and tempted to "just make it work." The system slowed that impulse and enforced the right fix.
Where CORE Stands Now
We're not at full A3 autonomy yet. There's still an honest checklist of 8 remaining gaps—including rollback safety on partial execution failures, DB-level concurrency constraints, and the Logic Conservation Gate from an earlier test.
But Tier 1 autonomous actions now work. The loop has closed.
The system that was broken used its own constitutional rules to enforce the fix that unblocked it.
GitHub: https://github.com/DariuszNewecki/CORE
Previous posts in the series:
- My AI Has 22 Workers, 2,470 Resolved Violations, and Still Can't Call Itself Autonomous. Here's the Gap.
- My AI Governance System Passed Its Own Audit. Then I Wrote One Rule. Now It Fails. That's the Point. (and the rest of the CORE series)
This version should slot right into your series. It's around 4–5 min read, maintains your voice, and emphasizes the self-referential governance aspect that readers seem to engage with. The code blocks are focused and helpful without overwhelming the narrative.
If you want any tweaks (e.g., more/less detail on a specific bug, different emphasis on a lesson, or adjusting the previous posts links), just say the word.
Top comments (0)