Skip to content

fix: align persisted-record slugs and stabilize timeout tests - #1412

Merged
steipete merged 1 commit into
mainfrom
fix/deslop-campaign-bugs-3
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/deslop-campaign-bugs-3

Conversation

@steipete

@steipete steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Persisted apply-record readers used a different repository-slug normalizer from the writer. A record for openclaw/some.repo or openclaw/some_repo was stored under its literal name but looked up under openclaw-some-repo. Repeated hyphens and trailing hyphens were also collapsed or trimmed, potentially selecting another repository's cursor timestamp.

Loaded macOS hosts also made timing tests fail despite correct runtime behavior: the checkout assertion included repository preparation, the dead-owner assertion included the entire record write, and snapshot admission shared an unnecessarily short fixture budget.

Why This Change Was Made

Use the existing writer's slugForRepo helper for all workflow-record lookups and delete both local slug helpers. The regression table exercises dotted, underscored, mixed-case, hyphenated, repeated-hyphen, and trailing-hyphen names through proposal selection, inventory, comment synchronization, and open/closed cursor reads.

Measure the checkout subprocess with a monotonic clock, retaining the two-second bound and exercising a hung child with the supplied one-millisecond timeout. Assert that dead-owner recovery does not enter the lock wait, and release the live holder only after its contender observes the occupied lock. Give snapshot admission fixtures a bounded two-minute budget and pass the remaining budget into the agent runner; deadline-specific tests retain their existing limits.

User Impact

The timeout-test changes are behavior-neutral; no runtime timeout, config, or workflow change. The intentional bug fix makes persisted-record lookup honor the existing writer contract. No new runtime contract or storage migration is introduced.

Resolution changes only for repository names whose literal dots, underscores, repeated hyphens, or trailing hyphens were previously replaced, collapsed, or trimmed. Mixed case still resolves to lowercase. Ordinary hyphenated names are unchanged.

The current configured targets are openclaw/openclaw, openclaw/clawhub, openclaw/clawsweeper, openclaw/openclaw-facetime, openclaw/fs-safe, openclaw/crabbox, and steipete/camsnap. Worker TARGET_REPOS lists the first three plus openclaw/fs-safe; apply targets are openclaw/openclaw and optional openclaw/clawhub. None changes resolution. The hosted registry uses the same configuration, with generic fallback owners openclaw and steipete; this audit checks configured targets, not an enumeration of every dynamically admitted repository.

Current main was checked through the GitHub contents API. git log -S 'target_repo' -- config/target-repositories.json and git log -S 'TARGET_REPOS =' -- dashboard/wrangler.toml, plus inspection of every historical target-config revision, found no configured dotted or underscored name. The additional historical explicit target was openclaw/openclaw-windows-node.

Evidence

pr-behavior-proof contract:

  • Claim: persisted workflow reads resolve the canonical writer namespace, and the timing fixtures tolerate scheduling delays without changing production deadlines or retries.
  • Exercised surface: built workflow utilities reading/writing real temporary records and cursor files; actual subprocess timeout, live/dead process locks, scanner snapshot admission, and terminal cleanup.
  • Scenario/fixture: six repository-name cases, one eligible and one inconsistent record, open-to-closed movement, a hung checkout substitute, a held lock released after observed contention, and the repeated regular-snapshot OID fixture.
  • Command/environment: macOS arm64, Node v26.8.1, pnpm 11.10.0. For the behavior-neutral test refactor, proof is the full pnpm run check run plus the targeted suites, explicitly supplemented by before/after artificial load and injected scheduling gaps.
  • Observable result: the pre-fix slug regression passed only the ordinary-hyphen control (1 pass, 5 failures); all six now find item 41 and its cursor timestamp. The pre-fix load run reproduced the dead-owner elapsed assertion. A 2.2-second setup delay and a simulated 31-second snapshot scheduling gap failed the old tests; both now pass while their intended bounds remain enforced.
  • Artifact/trace: local logs under /tmp/deslop-bugs3-*, including slug-regression-before.log, slug-after.log, before-targeted.log, after-targeted.log, jitter-after.log, and check.log (the full gate). Pass summaries are below.
  • Limits: local macOS proof; no live apply, remote record mutation, Linux/Windows execution, or production deployment. The requested terminal watchdog scenario passed before and after and was left unchanged. The baseline also exposed intermittent ENOTEMPTY cleanup failures at test/live-proof-review-environment.test.ts:1262 and :1296; both passed focused reruns and the later load run. Each failed cleanup left a cleanup.result.tmp.scan.* file, consistent with a cleanup scanner writing after removal began. Their separate cleanup race is not claimed fixed here.

The load harness ran these four commands concurrently, unchanged before and after:

pnpm run check:static
pnpm run check:static
node --test test/clawsweeper.test.ts
node --test test/repair/target-validation.test.ts test/action-ledger-runtime.test.ts test/agent-input-scan.test.ts test/live-proof-review-environment.test.ts

Validation commands and summaries:

corepack enable >/dev/null 2>&1; pnpm install --prefer-offline — PASS
pnpm run format — PASS
pnpm run build:all — PASS
node scripts/run-node-tests.mjs repair -- --test-name-pattern='workflow record lookup preserves the writer slug|pinned-base reproduction bounds' — PASS (135 reported tests)
node scripts/run-node-tests.mjs unit -- --test-name-pattern='producer locks reclaim fresh dead|locks retain live V1|reviewed synthetic fixture admission: repeated regular snapshot OID' — PASS (172 reported tests)
node --test test/repair/workflow-utils.test.ts
ℹ tests 77
ℹ pass 77
ℹ fail 0

node --import /tmp/deslop-bugs3-jitter.mjs --test --test-name-pattern='pinned-base reproduction bounds|producer locks reclaim fresh dead|reviewed synthetic fixture admission: repeated regular snapshot OID' test/repair/target-validation.test.ts test/action-ledger-runtime.test.ts test/agent-input-scan.test.ts
ℹ tests 3
ℹ pass 3
ℹ fail 0

python3 /tmp/deslop-bugs3-load.py after
static-a: exit=0
static-b: exit=0
large: exit=0 (76 passed)
ℹ tests 514
ℹ pass 509
ℹ fail 0
ℹ skipped 5

pnpm run check
Changed-file coverage:
ℹ tests 13
ℹ pass 13
ℹ fail 0
ℹ all files | 100.00 | 88.61 | 100.00 |
Full coverage:
ℹ tests 4822
ℹ pass 4809
ℹ fail 0
ℹ cancelled 0
ℹ skipped 13
ℹ all files | 85.73 | 76.18 | 89.70 |

Independent review: Codex autoreview scoped-clean, no accepted/actionable findings at P0/P1 (--mode local --base origin/main --max-priority P1, with context explaining the unrelated upstream-only differences). Validated head: 3bbb195.

OpenClaw Bay not affected: no dashboard changes.

Scope Added Removed Net
Production 6 18 -12
Tests 167 72 +95
Docs/changelog 8 0 +8

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review September 4, 2026 07:59
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 4:05 AM ET / 08:05 UTC.

ClawSweeper review

What this changes

The PR aligns persisted-record readers with the writer’s repository-name encoding and makes timeout tests less sensitive to host scheduling delays.

Merge readiness

✅ Ready for maintainer review

This remains useful: current main still misreads valid persisted-record namespaces, and no verified merged replacement resolves the problem. No blocking patch defect was found.

Priority: P2
Reviewed head: 3bbb1957b8aa28a5f89651a1d181e06d0d2db44c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant filesystem/process evidence, reported full validation, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured macOS evidence exercises built workflow utilities against real record and cursor files, reporting all six namespace cases passing after the fix. Real subprocess contention, injected scheduling gaps, and load runs support the test changes; coverage is local and does not claim live apply or deployment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured macOS evidence exercises built workflow utilities against real record and cursor files, reporting all six namespace cases passing after the fix. Real subprocess contention, injected scheduling gaps, and load runs support the test changes; coverage is local and does not claim live apply or deployment.
Evidence reviewed 12 items Repository policy: Read the complete root policy and checked changed-path ancestors; no nested AGENTS.md or maintainer-note files were found. Applied the flat record layout, controlled behavior-proof requirement, and Bay impact guidance.
Verified introduced scope: The introduced delta contains seven files. The test merge has the pinned main commit followed by the exact PR head as its raw parents; its comparison against main contains those same seven files.
Current main still needs the fix: Main retains targetSlug for proposal selection, inventory, and apply timestamps. That normalizer collapses punctuation and repeated hyphens, while comment synchronization already preserves them.
Findings None None.
Security None None.

How this fits together

ClawSweeper hydrates review records from its canonical Worker store before selecting apply and comment-sync work. These utilities read those local records and maintain cursors that determine which items subsequent runs process.

flowchart TD
  A[Repository name] --> B[Canonical repository slug]
  B --> C[Hydrated review records]
  C --> D[Proposal and comment selection]
  D --> E[Apply and comment synchronization]
  E --> F[Cursor update]
  C --> F
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production +6/-18 (net -12); tests +167/-72 (net +95) The fix removes duplicate normalization while adding targeted namespace and scheduling coverage.
Namespace coverage 6 name variants; 2 record locations Coverage includes punctuation, case, repeated/trailing hyphens, and cursor reads before and after archival.

Technical review

Best possible solution:

Keep one canonical record namespace across publication, selection, synchronization, and cursor recovery while preserving production deadlines.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main readers collapse repository punctuation that the writer preserves, so a canonical dotted or underscored record is missed. This review established the path from source; it did not execute a reproduction.

Is this the best way to solve the issue?

Yes: reusing the existing writer helper removes the conflicting implementation, and the revised timing assertions isolate the behavior they intend to bound.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 238d7b531598.

Labels

Label changes:

  • add P2: This repairs a bounded record-lookup defect and flaky timing coverage without evidence of a currently blocked configured target.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured macOS evidence exercises built workflow utilities against real record and cursor files, reporting all six namespace cases passing after the fix. Real subprocess contention, injected scheduling gaps, and load runs support the test changes; coverage is local and does not claim live apply or deployment.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured macOS evidence exercises built workflow utilities against real record and cursor files, reporting all six namespace cases passing after the fix. Real subprocess contention, injected scheduling gaps, and load runs support the test changes; coverage is local and does not claim live apply or deployment.

Label justifications:

  • P2: This repairs a bounded record-lookup defect and flaky timing coverage without evidence of a currently blocked configured target.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured macOS evidence exercises built workflow utilities against real record and cursor files, reporting all six namespace cases passing after the fix. Real subprocess contention, injected scheduling gaps, and load runs support the test changes; coverage is local and does not claim live apply or deployment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured macOS evidence exercises built workflow utilities against real record and cursor files, reporting all six namespace cases passing after the fix. Real subprocess contention, injected scheduling gaps, and load runs support the test changes; coverage is local and does not claim live apply or deployment.

Evidence

What I checked:

  • Repository policy: Read the complete root policy and checked changed-path ancestors; no nested AGENTS.md or maintainer-note files were found. Applied the flat record layout, controlled behavior-proof requirement, and Bay impact guidance. (AGENTS.md:1, 3bbb1957b8aa)
  • Verified introduced scope: The introduced delta contains seven files. The test merge has the pinned main commit followed by the exact PR head as its raw parents; its comparison against main contains those same seven files. (7bc5f138bf56)
  • Current main still needs the fix: Main retains targetSlug for proposal selection, inventory, and apply timestamps. That normalizer collapses punctuation and repeated hyphens, while comment synchronization already preserves them. (src/repair/workflow-utils.ts:1356, 238d7b531598)
  • Existing writer contract: Repository profiles normalize case and derive their slug using slugForRepo, which preserves dots, underscores, and hyphens. Record publication uses profile.slug, hydration preserves the supplied slug, and the existing event-record reader follows this same convention. (src/repository-profiles.ts:256, 3bbb1957b8aa)
  • Filesystem behavior coverage: Six repository-name fixtures call the production selection, inventory, comment-sync, and cursor functions against real temporary files. They check eligible versus inconsistent records and recover the stored timestamp from both items and closed directories. (test/repair/workflow-utils.test.ts:3268, 3bbb1957b8aa)
  • Timeout assertions retain their purpose: The checkout fixture still verifies the supplied one-millisecond subprocess timeout, ETIMEDOUT, and a two-second elapsed bound. Lock contention now releases a real child only after the production wait path is observed; snapshot fixtures receive the remaining bounded budget. Production timeout implementations are unchanged. (test/repair/target-validation.test.ts:2366, 3bbb1957b8aa)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Landing: CI green on exact head 3bbb195, ClawSweeper review reports real behavior verified (six-namespace slug cases against real record and cursor files, real subprocess lock contention, load runs) and no findings. Fixes the reader/writer slug divergence for dotted and underscored repositories (no configured target changes resolution) and replaces three wall-clock test assertions with mechanism-based ones.

@steipete
steipete merged commit 41caa32 into main Sep 4, 2026
26 checks passed
@steipete
steipete deleted the fix/deslop-campaign-bugs-3 branch September 4, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant