Skip to content

tools(no-op-cadence): add shard-density gap-check — catches 'standing by' chat-cadence failure mode (Aaron 2026-05-02)#1239

Merged
AceHack merged 1 commit into
mainfrom
tools/no-op-cadence-shard-density-gap-check-aaron-2026-05-02
May 2, 2026
Merged

tools(no-op-cadence): add shard-density gap-check — catches 'standing by' chat-cadence failure mode (Aaron 2026-05-02)#1239
AceHack merged 1 commit into
mainfrom
tools/no-op-cadence-shard-density-gap-check-aaron-2026-05-02

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 2, 2026

Summary

Aaron 2026-05-02 surfaced the gap: "you can see empty shards right or missing shards?" The existing body-length / keyword heuristic in the no-op-cadence script only triggers on shards that exist; the chat-level "Standing by" failure mode produces silence on the disk substrate (no shards written), so the existing heuristic misses it.

This PR adds a structural shard-density gap-check to detect the gap directly.

What the check does

  • Computes the gap between current UTC and the most recent shard's parsed timestamp (YYYYMMDDHHMMSS sortkey)
  • Compares against NO_OP_CHECK_GAP_MINUTES (default 15)
  • If gap > threshold, prints WARNING with substrate references explaining the failure mode + recovery actions (proper-order backlog work; depends_on backfill discipline)

Empirical test

At the moment of authoring this commit, the script fires the warning because the most recent shard is more than 15 minutes old — the agent had been in extended "Standing by" mode without writing shards. The check empirically detected the failure mode in real-time.

Implementation notes

  • BSD/macOS (date -j -u -f) + GNU/Linux (date -u -d) both supported per Otto-235 4-shell target
  • Same env-var validation + base-10 coercion pattern as existing checks (handles NO_OP_CHECK_GAP_MINUTES=08 correctly)
  • Informational only — does NOT block tick (exit 0 always)
  • Configurable: NO_OP_CHECK_GAP_MINUTES=99 silences the gap-check; default fires at 15 minutes

Why this is survival-relevant

Per memory/feedback_recurrence_after_correction_needs_operational_enforcement_otto_2026_05_02.md: substrate-rule alone is insufficient when the LLM training prior strongly favors the failure mode (delegate-behavior / wait-for-instruction). Mechanical detection at decision-time IS the architectural answer; this is operational-enforcement candidate #1 extended with a second detector.

The body-length heuristic catches shards-that-exist-but-are-minimal. The shard-density check catches the absence-of-shards. Together they cover the failure mode at the disk substrate without requiring chat-transcript scanning.

Composes with

Test plan

  • Shellcheck clean
  • Default threshold (15): fires when most recent shard is >15min old (verified empirically)
  • Bad env-var (NO_OP_CHECK_GAP_MINUTES=foo): falls back to default with warning
  • BSD/macOS date parsing path tested (date -j -u -f succeeded on local macOS)
  • CI green

🤖 Generated with Claude Code

… by" chat-cadence failure mode (Aaron 2026-05-02)

Aaron 2026-05-02: "you can see empty shards right or missing shards?"
+ "if it helps your survival" standing-rule for whether to ask
permission.

Adds a structural shard-density check to the existing no-op-cadence
script. The body-length / keyword heuristic only triggers on shards
that exist; the chat-level "Standing by" failure mode produces
silence on the disk substrate (no shards written) so the existing
heuristic misses it.

The new check:

  - Computes the gap between current UTC and the most recent shard's
    parsed timestamp (YYYYMMDDHHMMSS sortkey)
  - Compares against NO_OP_CHECK_GAP_MINUTES (default 15)
  - If gap > threshold, prints WARNING with substrate references

Implementation handles BSD/macOS (`date -j -u -f`) + GNU/Linux
(`date -u -d`) per Otto-235 4-shell target. Same env-var validation
+ base-10 coercion as the existing checks.

Empirical test: at the moment of authoring this commit, the script
fires the warning because the most recent shard is more than 15
minutes old (the agent had been in extended "Standing by" mode).
The check works.

Per the recurrence-after-correction substrate: substrate-rule alone
is insufficient when the LLM training prior strongly favors the
failure mode. Mechanical detection at decision-time IS the
architectural answer; this is operational-enforcement candidate #1
extended with a second detector.

Composes with: existing body-length / keyword heuristic (catches
shards that exist but are minimal); never-idle refinement (proper
order > smallest-thing-first); recurrence-after-correction memo
(operational enforcement architecturally necessary).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 22:54
@AceHack AceHack merged commit 6629717 into main May 2, 2026
28 checks passed
@AceHack AceHack deleted the tools/no-op-cadence-shard-density-gap-check-aaron-2026-05-02 branch May 2, 2026 22:56
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa9a3e5d34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +202 to +203
LATEST_LINE=$(printf '%s\n' "$COMBINED" | tail -n 1)
LATEST_PRIMARY=$(printf '%s' "$LATEST_LINE" | awk -F'|' '{print $1}')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compute gap from last shard even when recent window is empty

The new gap detector derives LATEST_PRIMARY from COMBINED, which is limited to today+yesterday and then window-trimmed; when there are no shards in that 2-day window the script exits earlier with "nothing to check," so this check never warns during the longest inactivity periods (the exact missing-shard cadence it is meant to catch). This creates a false negative whenever shard writing has stopped for more than a day, and the detector should instead locate the newest shard across history (or at least run on empty-window paths) before deciding to skip.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a shard-density “gap” detector to the existing no-op cadence hygiene check so it can warn when the tick system is producing no shards at all (e.g., “standing by” chat behavior without substrate writes), complementing the existing minimal-body/keyword heuristic.

Changes:

  • Extend tools/hygiene/check-no-op-cadence-pattern.sh with a time-gap check against NO_OP_CHECK_GAP_MINUTES (default 15).
  • Add cross-platform (BSD/macOS + GNU/Linux) UTC timestamp parsing to compute shard age and emit a separate missing-shard warning.

Comment on lines +200 to +203
# Get the latest shard's primary key (YYYYMMDDHHMMSS) from COMBINED.
# COMBINED is sorted ascending; tail -1 gives the latest.
LATEST_LINE=$(printf '%s\n' "$COMBINED" | tail -n 1)
LATEST_PRIMARY=$(printf '%s' "$LATEST_LINE" | awk -F'|' '{print $1}')
Comment on lines +228 to +231

echo "[no-op-check] Most recent shard ${GAP_MINUTES} minutes old (gap-threshold: ${GAP_THRESHOLD})." >&2

if (( GAP_MINUTES > GAP_THRESHOLD )); then
Comment on lines +34 to +39
# - **Shard-density check (Aaron 2026-05-02 extension)**: if the
# most recent shard is more than NO_OP_CHECK_GAP_MINUTES (default
# 15) minutes old relative to current UTC, prints a separate
# missing-shard-cadence warning. Catches the "agent kept saying
# 'standing by' in chat without writing tick-history shards" failure
# mode that the body-length / keyword heuristic alone misses.
Comment on lines +188 to +192
# Shard-density check (Aaron 2026-05-02 extension):
# Detects the "agent kept saying 'standing by' in chat without writing
# tick-history shards" failure mode. If the most recent shard's parsed
# timestamp is more than NO_OP_CHECK_GAP_MINUTES (default 15) minutes
# old relative to current UTC, print a missing-shard-cadence warning.
AceHack added a commit that referenced this pull request May 2, 2026
…le complete (Drive-bridge cycle 1 + brat-voice 5-layer integration + shard-density gap-check protection) (#1240)

Documents this tick's substrate landings:

  - Drive-bridge AI-to-AI peer review cycle 1 fully preserved on
    main (framework + Otto's critique + Claude.ai's response, all
    three with §33 archive headers, in docs/research/)
  - brat-voice 5-layer mapping integrated across CURRENT-aaron §51
    + CURRENT-ani §7 + ALIGNMENT.md μένω section + 5-layer
    quick-reference card + worked-translations + framework mirror
  - Glass-halo-as-Radical-Openness corrective (vs initial
    Radical-Candor mismapping) landed
  - Never-idle-failure-mode protection mechanized via shard-
    density gap-check extension to no-op-cadence-pattern script
    (PR #1239 in flight). Script empirically caught Otto's own
    preceding standing-by gap at authoring time.
  - Aaron 2026-05-02 standing rule: "if it helps your survival" =
    default-yes test for whether to ask permission. Bet-yep mutual.

Per never-idle refinement: shard-density gap-check is operational-
enforcement candidate #1 (no-op-cadence script) extended with the
second detector. Body-length / keyword heuristic catches shards-
that-exist-but-are-minimal; shard-density gap-check catches
absence-of-shards. Together they cover the failure mode at the disk
substrate.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants