Skip to content

Make the v3 return supplement usable without our code: exporter defaults, reference predict, sealed roles, test-opening policy; CI timeout 90 - #45

Merged
Jeffreyliu0131 merged 6 commits into
mainfrom
claude/161-return-v3-plugin
Oct 13, 2026
Merged

Jeffreyliu0131 merged 6 commits into
mainfrom
claude/161-return-v3-plugin

Conversation

@Jeffreyliu0131

Copy link
Copy Markdown
Collaborator

Closes the gaps a from-scratch read of the v3 return supplement (as the data/model owner's agent) still hit after #44, and raises the CI timeout so the regression gate on main can finish again.

What changes

  • Encoder returns can be produced and self-checked without our code: the exporter's default max_tokens is 512 (the spec records that one learner sentence measured 391–474 tokens, so the earlier 256 sample would abstain on everything); encoder-return.md §5.1 lists every abstention condition the product applies (input_problem, over-length, missing evidence) and reference/export_hf_return.py predict reproduces the product loader — pooling, aggregation, thresholds, abstentions, CPU float32, recomputed after_weights — so the owner can compare their dev predictions before returning them (0 mismatches against the product loader on real xlm-roberta-base weights with untrained heads). The spec states the pinned inference versions, the pooler requirement and how to save a XLMRobertaForSequenceClassification model into this layout.
  • Sealed data packages carry artifact_roles for encoder returns, so validate-handoff no longer sends them back; dataset-split-sealed-v1.md §7 and the W07 handbook describe the pending→accept path for real data (an authoritative-source reader we provide once the data plan arrives; interface draft --source-authority, not implemented yet) and note that legitimate abstention rows are recorded as pending (exit 2) under the existing convention.
  • Held-out test opening policy documented as the code actually behaves: each freeze directory opens once; one campaign may approve several candidates (LR, encoder, fusion each open once — reproduced); a second freeze directory for the same candidate is prevented by process and git history, not by code, so the spec says so.
  • Linear exporter: writes a training-notes.md template and offers write_predictions as the test-prediction entry point, which verifies all six arrays and both vectorizers against the fitted objects before writing anything (linear_objects_not_exported: <field>), and checks the notes path before creating files.
  • Package README gains §10 "three tightenings relative to v2 (please confirm)": reload by our loader with tolerance instead of running the owner's command; the linear evidence head is required for product registration; encoder structure, thresholds, pinned inference versions and the built-in fusion selection rule. The v2 frozen package is untouched; README.md is untouched.
  • CI: timeout-minutes 40 → 90 (the suite grew past 40 minutes this wave; the last green main run took 36). Concurrency settings unchanged.

Verification

Independent review 080-review-161.md: first round sent back for two small items (contradictory test-opening wording; write_predictions only verified part of the arrays), fixed in beabc89 with 14 tamper/error-path tests that were red before the fix. Targeted suites 441 passed (17 new IDs, 0 missing / 0 regressed against 5a529ea); optional encoder suite 31 passed; XLM-R smoke 3 passed; check_fast and lint clean; 13 new default-environment IDs appended to the baseline. Package SHA256SUMS (13 entries, own sha256 073e6759…cf14) self-checks in place and after copying file by file. The full suite runs in CI on main. Receipt: 完成回执/claude-coordination/161-v3回传包一插即用.md.

main 5a529ea was cancelled at the 40-minute limit; the last success
(f67e915) took 36 minutes and this wave added about 360 backend tests.
No step-level timeouts exist; concurrency and cancel-in-progress unchanged.
Encoder reference script (docs/data/return-v3/reference/export_hf_return.py):
- export: --max-tokens defaults to 512 (XLM-R base limit); over the encoder's own limit
  it refuses and names the limit; a missing pooler points to the recipe; prints the
  installed runtime and whether it matches the product's pinned versions.
- predict (new): loads a return exactly as RoleCraft's loader does (seed, fast tokenizer,
  safetensors, CPU float32, after_weights re-check) and writes v3 rows with the same
  abstentions (input_problem codes, no candidates, token limit, pack spans), mean pooling,
  pair_aggregate and evidence threshold; --labels lists rows our format check rejects
  (evidence_missing); never writes into a sealed return.
- seal: writes artifact_roles, so validate-handoff --checkpoint-manifest accepts encoder
  returns (it required the roles for every non-linear return).

Linear reference script: export_linear_return writes the training-notes template;
write_predictions writes test rows in the dev format, outside the return directory.

Specs: encoder-return (512 and the 391-474 token measurement, abstention table 5.1,
runtime 11.1, pooler and XLMRobertaForSequenceClassification recipe, artifact_roles,
predict); dataset-split-sealed section 7 (pending -> accept, interface draft);
test-opening (one opening per candidate per freeze directory, one campaign for all,
fusion declaration manifest); predictions-v3 (v2/v3 rows, v2 validator limits);
README section 10 (three tightenings relative to v2); W07/W08 manual lines.
SHA256SUMS regenerated (13 entries).

Tests: PLUG-01 (unit), PLUG-06/07 (integration), PLUG-02..05 (optional encoder);
ENC-01/03/05 pass the tiny BERT's 256 limit explicitly now that the default is 512.
…G-01, PLUG-06, PLUG-07 x2; 4 IDs)

Appended only: backend 2628 -> 2632 IDs, frontend unchanged, source_commit unchanged;
compared with 5a529ea's baseline: 0 missing, 0 changed outcomes. Sources:
tests/unit/test_return_v3_package.py (1) and tests/integration/test_return_v3_plugin.py (3).
….05, 11 items)

docs/HANDOVER.md: the optional encoder command now lists five files, 34 items with the
XLM-R smoke (17 + 2 + 1 + 11 + 3); docs/data/expansion-v3-w08.md: the same file in the
CPU encoder environment command and one line on what it checks.
…ictions checks)

- test-opening-v1.md: the code guarantees one opening per freeze directory; the campaign
  is not bound to a freeze, so another freeze directory for the same candidate could open
  again (measured: exit 0). Written as a process rule: one freeze directory per candidate,
  created by us after the user confirms and committed to git with the campaign and the
  opening record. The opening paragraph now says "the second opening of the same freeze
  directory is refused". W08 manual aligned (HANDOVER has no such statement).
- export_sklearn_linear.write_predictions: before writing any row, every array (coef,
  intercept, evidence_coef, evidence_intercept, idf, evidence_idf) and both vectorizers
  (main, and the evidence head: shared or its own) must equal the export
  (linear_objects_not_exported: <field>); prediction_output_inside_return and
  prediction_output_exists name their refusals.
- export_linear_return: the training notes path is checked before anything is written
  (training_notes_path_invalid): relative, inside the return, not a member or under linear/.
- README: max_tokens defaults to 512 and may not exceed the tokenizer's limit;
  dataset-split-sealed section 6 and encoder-return 5.1: validate-handoff records lawful
  abstention rows as pending (exit 2), the existing rule, confirmed by us at the joint check.
- Tests: PLUG-07 tamper cases (8, one per array or vectorizer, match on the field) and bad
  notes paths (5); the existing raises now match its code. SHA256SUMS regenerated (13).
…nd notes-path cases; 13 IDs)

Appended only: backend 2632 -> 2645, frontend unchanged, source_commit unchanged. Source:
tests/integration/test_return_v3_plugin.py (8 tamper cases, 5 notes-path cases).
@Jeffreyliu0131
Jeffreyliu0131 merged commit 5c297a3 into main Oct 13, 2026
1 check failed
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