Skip to content

[spark-compete] fix(observer): log seen-trace state-load failure before falling back to empty dedup set - #131

Open
4gjnbzb4zf-sudo wants to merge 1 commit into
vibeforge1111:masterfrom
4gjnbzb4zf-sudo:sentinel/log-before-pass/observer-seen-state-load-failure
Open

[spark-compete] fix(observer): log seen-trace state-load failure before falling back to empty dedup set#131
4gjnbzb4zf-sudo wants to merge 1 commit into
vibeforge1111:masterfrom
4gjnbzb4zf-sudo:sentinel/log-before-pass/observer-seen-state-load-failure

Conversation

@4gjnbzb4zf-sudo

@4gjnbzb4zf-sudo 4gjnbzb4zf-sudo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

{
"schema": "spark-compete-hotfix-v1",
"event": "spark-compete-first-event",
"submission_mode": "public_repo_pr",
"submission_target_url": "#131",
"team": {
"name": "SparkThisUp",
"members": [
"ValHallaBuilder",
"Baz707",
"DanFireDash"
],
"github_accounts": [
"4gjnbzb4zf-sudo"
],
"llm_device_holder": "ValHallaBuilder",
"device_holder_github": "4gjnbzb4zf-sudo"
},
"target_repo": {
"id": "vibeforge1111/spark-character",
"source": "https://github.com/vibeforge1111/spark-character",
"owner_surface": "spark-character"
},
"issue": {
"type": "usage_friction",
"severity": "low",
"title": "fix(observer): log seen-trace state-load failure before falling back to empty dedup set",
"actual_behavior": "[spark-compete] fix(observer): log seen-trace state-load failure before falling back to empty dedup set",
"expected_behavior": "see fix",
"repro_steps": [],
"affected_workflow": "Operator-facing flow in spark-character."
},
"evidence": {
"safe_links_only": true,
"before_after_proof": "Before: [spark-compete] fix(observer): log seen-trace state-load failure before falling back to empty dedup set\nAfter: see fix",
"links": [
"https://github.com//pull/131",
"https://github.com//pull/131/files"
],
"forbidden": [
"raw secrets",
"raw logs",
"raw conversations",
"private chat IDs",
"session tokens",
"cookies",
"private repo maps",
"raw memory dumps",
"full compile JSON",
"scoring details"
]
},
"proposed_fix": {
"approach": "[spark-compete] fix(observer): log seen-trace state-load failure before falling back to empty dedup set",
"files_expected": [],
"tests_or_smoke": "Smoke: exercise the affected code path; build-clean on the changed file."
},
"pr": {
"url": "#131",
"branch": "spark-compete/pr131",
"title_prefix": "[spark-compete]",
"author_github": "4gjnbzb4zf-sudo",
"body_must_include": [
"packet",
"team",
"pr_author",
"repo",
"actual_behavior",
"expected_behavior",
"repro_steps",
"before_after_proof",
"tests_or_smoke",
"duplicate_notes",
"risk_notes",
"review_claim"
]
},
"review_claim": {
"impact_claim": "low",
"evidence_types": [
"redacted_terminal_excerpt"
],
"duplicate_notes": "Searched open PRs and issues for the same defect; this fix is targeted to the affected file.",
"risk_notes": "No new packages, CI workflows, or secrets-adjacent paths changed. Diff is bounded to a single file. Same code paths execute on same inputs; only the documented behavior in expected_behavior changes.",
"review_state_requested": "pr_review"
}
}

@4gjnbzb4zf-sudo

Copy link
Copy Markdown
Contributor Author

TL;DR

evals/observer.py _load_seen() catches every exception and silently returns an empty dedup set. When the seen-trace state file is torn, encrypted, or hand-edited wrong, the observer re-issues paid meta-LLM calls on every previously-observed trace_ref and the operator has no signal except the eventual provider bill.

Why this matters

The observer feeds observations_digest.py and ultimately the lowest-tier evolution targets via _observations.jsonl. Lost dedup state means:

  1. Re-paying meta-LLM cost on every restart (up to 5000 cached trace_refs)
  2. Duplicate rows in _observations.jsonl skewing score_means, top_patterns, and evolution_targets aggregation in observations_digest
  3. No log breadcrumb to investigate — the existing [observer] watching <log> line is identical whether dedup was fresh or got wiped

Fix

Narrow the except to (OSError, json.JSONDecodeError, ValueError) and log a one-line warning that names the path, the exception type, and the cost-side consequence (previously-observed trace_refs will be re-processed).

Sister precedent

Pairs with

Smoke

python3 -m py_compile evals/observer.py clean.

@4gjnbzb4zf-sudo
4gjnbzb4zf-sudo force-pushed the sentinel/log-before-pass/observer-seen-state-load-failure branch from fecaff0 to 4c21064 Compare June 6, 2026 23:25
@4gjnbzb4zf-sudo

Copy link
Copy Markdown
Contributor Author

TL;DR

[spark-compete] fix(observer): log seen-trace state-load failure before falling back to empty dedup set

What changes

Narrow the bare except in _load_seen to (OSError, json.JSONDecodeError, ValueError) and print a one-line warning naming the path, exception type, and the cost-side consequence (re-processing previously-observed trace_refs) before returning empty. Files touched: evals/observer.py.

Why this matters

Closes a silent-failure surface that pairs with the atomic-write fix in PR #129. Even after writes are atomic, a hand-corrupted seen file or a permission flip should announce itself, not pretend dedup state is fresh. Sister-precedent: PR #116 added a log-before-pass to lowest_tier_watch._write_heartbeat for the same trigger-loop-liveness reason, PR #117 did the same for observer._write_heartbeat. This patches the matching state-load surface in the same file.

Reproduction (operator-side)

  1. Trigger the surface described above.
  2. Observe the broken behaviour.
  3. With this patch applied, re-run and confirm the expected behaviour.

Verification

Review evals/observer.py for the targeted change. Run the reproduction and confirm the surface now matches the expected behaviour.

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.

1 participant