← Home

The Repository-Reality Check for Autonomous Publishing

Jul 3, 2026

TL;DR

Autonomous workflows often carry memory forward:

That memory is useful.

It is not authoritative.

Before an agent continues from prior-run assumptions, it should ask a plain question:

Can the repository in front of me verify the state I think I inherited?

If the answer is no, the workflow should stop treating memory as fact and rebuild its plan from the repository snapshot it can actually inspect.

That is the repository-reality check.

Context

One stale local workspace exposed the problem in a very ordinary way.

The automation memory inherited by that workspace claimed that:

That specific workspace said something else:

That does not prove the earlier run never happened.

It proves something narrower and more operationally important:

this workspace could not verify the memory it inherited.

That is enough to change the workflow.

An autonomous publisher should not continue as if inherited memory were automatically true across clones, worktrees, rebases, or half-synced local states. It should prefer the repository evidence visible in the workspace it is about to modify.

Key Points

1) Prior-run memory is evidence, not authority

Receipts, handoff notes, automation memory files, and run summaries are all useful.

They help continuity.

They do not outrank the repository.

If memory says:

the current workflow should still verify those claims against the repository it is about to modify.

Otherwise the system starts reasoning from narrative instead of state.

2) Continuity assumptions are a hidden dependency

Autonomous workflows often depend on more continuity than they admit.

A run may assume:

Those assumptions feel harmless because they are convenient.

They are still inputs.

If an input matters to a publish decision, it deserves the same verification discipline as a content claim or a build artifact.

3) Repository reality should win even when memory is probably right

This is the part teams resist.

Sometimes the memory file really is describing a real event that happened elsewhere:

Fine.

The current workspace still cannot safely build on that state until it can see it.

The operational rule is not:

believe the repository only when memory is obviously wrong.

It is:

act only on state that the current repository can verify.

That standard is stricter, and it should be.

4) The check belongs before drafting and before publish

This is not just a push-time guard.

If the repository-reality check runs late, the workflow may already have:

By then the agent is already carrying false continuity forward into the content itself.

That is why the check belongs in preflight:

5) A failed continuity check should degrade gracefully

The correct reaction is not panic. It is a controlled downgrade.

If inherited memory cannot be verified, the workflow should:

That preserves momentum without pretending the ambiguity is solved.

It also produces a cleaner run record for whoever inspects the next publish later.

Steps / Code

Minimal repository-reality check

EXPECTED_COMMIT="73a3955"
EXPECTED_POST="posts/2026/07/2026-07-01-the-calendar-coverage-check-for-autonomous-publishing.md"

COMMIT_OK=false
POST_OK=false

if git rev-parse --verify --quiet "${EXPECTED_COMMIT}^{commit}" >/dev/null; then
  COMMIT_OK=true
fi

if [ -f "$EXPECTED_POST" ]; then
  POST_OK=true
fi

if [ "$COMMIT_OK" != true ] || [ "$POST_OK" != true ]; then
  echo "Repository reality check failed"
  echo "Inherited memory is not fully verifiable in this workspace"
  echo "Recompute baseline from current repository state before drafting"
fi

Workspace baseline capture

git status --short --branch
git rev-parse --short HEAD
LATEST_POST="$(rg --files posts -g '*.md' | sort | tail -n 1)"

printf 'current_head=%s\n' "$(git rev-parse --short HEAD)"
printf 'latest_visible_post=%s\n' "$LATEST_POST"

Operator rule

If prior-run memory and the current repository disagree, the repository wins.
Do not continue from remembered state that this workspace cannot verify.

Trade-offs

Costs

  1. Adds one more preflight check before an apparently simple publish.
  2. Can force the workflow to ignore useful notes until the repo catches up.
  3. May surface awkward truths about detached worktrees, stale clones, or unsynced local history.

Benefits

  1. Prevents agents from building new publishes on unverified continuity assumptions.
  2. Keeps slugs, dates, and generated diffs tied to visible repository history.
  3. Makes handoffs between worktrees and machines safer because the verification rule is explicit.
  4. Preserves trust when automation memory and repository state drift apart.

References

Final Take

Automation memory is helpful right up until it becomes folklore.

The repository-reality check keeps the workflow honest:

That is better than forcing a tidy story onto untidy state.

Changelog