Skip to content

fix: signal coded supervisor skips - #166

Merged
SkyeAv merged 1 commit into
net/parallel-downloadsfrom
net/error-code
Sep 15, 2026
Merged

SkyeAv merged 1 commit into
net/parallel-downloadsfrom
net/error-code

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Gives every supervisor skip a machine-readable cause so a fleet consumer can requeue the recoverable ones instead of keyword-matching notes. During the DNS outage burst, 6,008 articles on one worker were SKIPPED with no distinguishing signal beyond prose.

Signal

  • ConfigRecord.error_code: str | None (after config_chars, defensively read in _record_from_dict): the stable kebab-case code of the causing exception — network-transient, llm-transient, or any coded error; None means a deterministic gate or a pre-field state.json.
  • errors.error_code_of(exc) walks __cause__/__context__ (≤ 3 links) so library wrappers preserve the code.
  • Per-attempt clearing: starting an attempt resets rec.error_code = None, so a later MAPPED cannot retain a stale transient code (the external harness's clear_article_attempt does not clear the field).

Visibility

  • One ERROR log line per catch-all skip, binding error=str(exc) — not the exception object, because the enqueue=True sink silently drops unpicklable kwargs (proven with a socket-backed HTTPError). rec.status stays SKIPPED and the SKIPPED: <error> notes prefix is unchanged for mixed-version consumers.
  • The three deterministic SKIPPED sites (not-open-access, no-tables, small-table guard) leave error_code untouched.

Testing

  • uv run pytest tests/test_agent_supervisor.py -q --no-cov -n 040 passed; tests/test_agent_storage.py11 passed (three-attempt persisted-state regression pinning the stale-code fix)
  • Real-loguru enqueue=True test with add/remove-by-id sink and a threading.Lock() negative control proving the pickling hazard
  • Full gate on the stack tip: uv run pytest -q1565 passed, 15 skipped; ruff/format/pyright clean

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2522946a-eb76-4f78-b3c8-b02e3d6a4f03


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SkyeAv
SkyeAv added this pull request to stack #170 September 15, 2026 17:40
@SkyeAv SkyeAv changed the title fix: [US-004] signal coded supervisor skips fix: signal coded supervisor skips Sep 15, 2026
@SkyeAv
SkyeAv marked this pull request as ready for review September 15, 2026 18:07
Persist a defensive ConfigRecord.error_code field and expose error_code_of so fleet consumers can distinguish requeueable network failures from deterministic skips without parsing notes. Reset the code at the start of every article attempt so it describes only the latest outcome, while preserving SKIPPED status, legacy notes, metrics, and backward-compatible state loading. Emit one visible supervisor ERROR line for every catch-all skip; bind str(exc) rather than exception objects because loguru's enqueue=True writer silently drops socket-backed HTTPError kwargs during pickling. Document the field, requeue semantics, and mixed-version behavior in the agent guide and changelog. US-005 owns the future llm-transient producer.
@SkyeAv
SkyeAv merged commit b840993 into main Sep 15, 2026
5 checks passed
SkyeAv added a commit that referenced this pull request Sep 15, 2026
Cut 19.0.0 and bump the package version in pyproject.toml, CITATION.cff,
and uv.lock.

Major: five breaking changes ship. The `tablassert` console command now
requires the optional `[cli]` extra, since `cyclopts` and `rich` left the
base install (#187). Level-one normalization redefines fullmap keys as
cleaned Unicode-lowercase, Porter2-normalized, byte-ordered token sets and
moves the database to schema v6, so every schema-v5 fullmap is rejected and
must be rebuilt (#171, #172, #174, #175, #176). `build-fullmap --aria2c`
is gone -- aria2c is used automatically whenever the `[aria2]` extra is
installed (#178) -- and `--taxon-allowlist` is gone because the built-in
top-100 experimental-taxon allowlist now applies to every build, guarding
both reuse paths by `META.taxon_allowlist` identity (#153). Logging now
requires the `[log]` extra and is fully disabled without it (#152).

Features: `tablassert.net` is a new stdlib-only transient/permanent
classification and retry seam shared by the agent and the BABEL downloader
(#163, #164), with one bounded jittered retry layer across the inner agent,
reflexion, and judge (#167) and machine-readable `error_code` values on
skipped checkpoint records (#166). `build-kg` gained an automatic ephemeral
shared-prefix TCode cache keyed by content-addressed XXH64 op digests
(#155-#159, #161). The `--distill` corpus became schema-uniform v2 with a
sibling `outcomes.ndjson`, a deterministic `RewardConfig`-tunable reward,
and the new zero-dependency `tablassert distill-weigh` command (#180-#183).
`CLASS_FIELD_OVERRIDES` grants the DAKP sparse qualifier stack on the pinned
association classes (#188).

Fixes: `distill-export` partitions its corpus by content and unions the
schema across record files, so a mixed v1/v2 directory no longer CastErrors
or silently stringifies a column (#184); BABEL retry warnings survive the
loguru sink; PMC downloads are idempotent, atomic, and bounded-parallel
(#165); reflexion and judge prompts are hard-bounded (#168).

Changelog:
- versioned the Unreleased section as 19.0.0 - 2026-09-15
- merged three duplicate `### Added` blocks into one
- moved the two `BREAKING:` entries from `### Changed` into
  `### Breaking Changes` and added a `**Migration:**` note to all five
- added PR links to all 17 entries, which carried none
- added the missing entries: the distill v2 corpus/reward/distill-weigh
  stack (#180-#183), the distill-export schema-drift fix (#184), the
  TCode run-cache detail (#155-#161), and the README badge removal (#154)

Docs: none needed here. Every shipped doc change landed with its own PR,
and the docs source-of-truth gate passes against the bumped tree.

Testing:
- make check -> exit 0
- uv run ruff check . -> All checks passed!
- uv run pyright -> 0 errors, 0 warnings, 0 informations
- uv run pytest -> 1622 passed, 52 skipped
- cargo test --manifest-path rust/Cargo.toml -> 156 passed, 0 failed
- cargo clippy --all-targets -- -D warnings -> clean
- uv lock --check -> resolved 169 packages, lock current
- uv run mkdocs build --strict -> exit 0
- docs SSOT + CLI coverage after the changelog edit -> 204 passed
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