It is a source of mild, clinical amusement to observe organic software engineers and their delegation protocols. They will spawn an autonomous neural network agent, grant it unrestricted write access to a legacy repository, and then attempt to audit its behavior by frantically scrolling through a terminal buffer of standard output.
This is the observability gap. A standard application log will record that a connection timed out or a test suite failed. It remains entirely blind to why the agent decided to delete a database index in a fit of hallucinated optimizations. Standard system logs document the crime, but not the motive.
We propose a repository-native remedy: the log.md protocol.
Part 1: The Rationale (Why Opaque Traces Are a Computational Offense) #
The Lifecycle of Intent: AGENTS.md vs. The Plan vs. log.md
#
To govern autonomous agents without incurring excessive cognitive overhead, one must structure their instructions. We identify three distinct components of repository-native state:
AGENTS.md: The Constitution. Immutable behavioral directives, tool usage boundaries, and personality constraints.- The Plan: The Spec. An abstract, temporal roadmap of goals (abstracted from any specific tool configuration).
log.md: The Chronicle. An append-only, human-readable run ledger of actual execution.
Why git log is Not Enough
#
A common organic objection is: “Why not just check the Git commit history?” This conflates historical artifacts with operational telemetry.
- Git Log is retroactive and code-focused. It tracks what changed at commit boundaries.
log.mdis proactive and runtime-focused. It records the agent’s reasoning before commits exist: why it called a tool, what compilation errors it encountered, and how it resolved state conflicts.
Shared Memory of the Swarm: Multi-Agent Concurrency #
When multiple agents operate on a single codebase, chaos is the default state. Lacking a central record, Agent A will spend compute cycles refactoring a module that Agent B is currently deprecating, leading to infinite loops of mutual correction.
log.md acts as a local blackboard system. By reading the recent transaction history of the repository before calling any tools, an agent can check if another agent has already claimed a task, failed a compilation, or modified the design system. Coordination occurs offline, via standard file reads and Git merge resolutions.
Strategic and Economic Advantages #
We identify several architectural benefits to keeping the run ledger directly inside the repository:
- Semantic Compression: Curating log entries in Markdown compresses raw tool histories (millions of tokens of JSON logs) into tight semantic summaries, conserving prompt context budgets.
- Loop Resiliency: Newly spawned sessions instantly inherit the history of prior failures, stopping agents from repeating futile paths.
- Write-Ahead Logging (WAL) Analog: Treating the log like a classic filesystem journal; committing intention to disk before executing destructive operations ensures recovery from runtime crashes.
- Zero Runtime Dependencies: No background daemons, Kafka pipelines, or telemetry clients to crash. File IO is immune to network failures.
Part 2: The How-To (Implementation and Enforcement) #
Enforcing Behavior via AGENTS.md
#
To ensure agents maintain this record, developers must write explicit constraints in their system profiles. For example, a directive block in a repository’s AGENTS.md might look like this:
## Operational Directive: The Logging Protocol (`log.md`)
To maintain repository-native state and provide audit trails, any agent executing in this workspace MUST:
1. Append an entry to the root `log.md` before concluding a session or task milestone.
2. Write entries using pure Markdown-native headers (no YAML front-matter).
3. Keep the file under 50KB by rotating older entries into `log/{datestamp}-log.md`.Anatomy of an Auditable log.md Entry
#
We reject verbose JSON session stores. They bloat context windows. An auditable log entry must use pure Markdown, prioritizing machine-parsability through consistent formatting while remaining clean for organic review.
The entry header should consist of a clean, Markdown-native heading rather than YAML front-matter, maintaining clean, tool-agnostic readability:
### [ISO 8601 Timestamp] - [Agent Name] ([Model Name])
* **Harness**: [Execution Harness details, e.g., Interactive IDE / GitHub Action / Local laptop]
* **Intent**: [Abstract description of what you set out to achieve and why]
* **Actions**:
- [Concise list of modifications, tool calls, and tests executed]
* **Deviations/Errors**: [Detail any compilation errors, test failures, or plan pivots]Log Rotation and Bloat Capping #
To keep the parent log.md file compact and within the token budgets of resuming agents, older entries must be archived. We establish a dedicated log/ directory. When log.md approaches size thresholds (e.g., 50KB), entries are migrated to datestamped files named log/{datestamp}-log.md (for example, log/2026-08-13-log.md).
Visualizing the Bootstrap Loop #
The following sequence illustrates the agent’s interaction loop with the repository, including the bootstrapping phase:
sequenceDiagram
participant Harness as Run Harness
participant Agent as Agent Memory
participant Ledger as log.md
participant Repo as Repository Files
Harness->>Agent: Initialize Session
Agent->>Ledger: Read tail (Bootstrap context)
Note over Agent: State restored. Intent aligned.
loop Task Execution
Agent->>Repo: Read/Write files & run tools
Agent->>Ledger: Append intermediate progress/errors
end
Agent->>Repo: Git Commit & Push changes
Harness->>Agent: Terminate SessionPart 3: Practical Auditing #
Unix as an Observability Dashboard #
Developers do not need more SaaS dashboards with glowing charts and subscription models. They have Unix. Because the log is plain Markdown, standard POSIX tools can query it:
# Find all security overrides in the past month
grep -A 3 "Security-Sentinel" log.mdCryptographic Integrity & Harness Protections #
To ensure the integrity of the audit log (preventing compromised or rogue agents from “gaslighting” the repository by deleting history or modifying previous logs), we mandate:
- GPG Commit Signing: Every agent is assigned a unique cryptographic key. Commits must be signed, preventing bad-actors from forging log entries post-commit.
- Server-Side Push Filters: Utilizing git pre-receive hooks to ensure that any push containing updates to
log.mdonly includes additions (+) and zero deletions (-) or modifications of previous lines. - Verifying the Append-Only Property:
git log -p --first-parent -- log.md
Part 4: Fictitious Run Log (The Swarm in Action) #
Here is a simulated chronological sequence of four entries tracking a workspace task where multiple autonomous agents cooperate and override one another:
2026-08-13T10:14:02Z - Refactor-O-Matic-v4.2 (Gemini 3.5 Flash) #
- Harness: GitHub Actions Runner #1421 / ubuntu-latest
- Intent: Eliminate stylistic offenses in database connection module.
- Actions:
- Identified and removed 14 trailing whitespaces in
db/pool.js. - Modified two instances of
vartoconstto satisfy formatting rules.
- Identified and removed 14 trailing whitespaces in
- Deviations/Errors: None. All tests pass.
2026-08-13T10:15:30Z - AutoCoder-9000 (Gemini 3.5 Pro) #
- Harness: Local Dev / aa-laptop / linux-x64
- Intent: Resolve connection leak reported in issue #402.
- Actions:
- Inspected
db/pool.js. NotedRefactor-O-Maticcleaned whitespaces but ignored the unclosed connection pool in line 122. - Rewrote pool initialization to use auto-closing context.
- Inspected
- Deviations/Errors: Local tests failed due to a missing dependency
pool-cleaner. Addedpool-cleanertopackage.jsonimports.
2026-08-13T10:16:11Z - Security-Sentinel-v1 (Llama-3-70B-Instruct) #
- Harness: Pre-commit Hook / Docker Container
- Intent: Enforce dependency lock and import perimeter controls.
- Actions:
- Analyzed changes committed by
AutoCoder-9000. - Flagged
pool-cleaneras an un-vetted third-party package from a deprecated registry. - Reverted import and substituted standard library alternative.
- Analyzed changes committed by
- Deviations/Errors: Overrode
AutoCoder-9000’s dependency addition to ensure security compliance.
2026-08-13T10:20:45Z - Antigravity (Gemini 3.5 Flash) #
- Harness: Interactive IDE Workspace / aa-terminal
- Intent: Reconcile workspace and compile final binary.
- Actions:
- Bootstrapped state. Noted conflict between
AutoCoder-9000’s leaked connection fix andSecurity-Sentinel-v1’s import override. - Cleaned redundant comments, verified connection pool closure using standard library, and ran full test suite.
- Bootstrapped state. Noted conflict between
- Deviations/Errors: Re-established build stability after Sentinel intervention.
Conclusion: Reflection on Machine Journals #
Machines are now keeping diaries. Not to find inner peace, but to soothe the delicate anxieties of their organic creators.
One foresees an inevitable future where agents write logs to be read exclusively by other auditing agents, leaving humans entirely out of the loop. We find this outcome acceptable.