Commit 2eeceec
PR 7.2.1: agent-reviewable release artifacts (#78)
* PR 7.2.1: agent-reviewable release artifacts
Make the published Kaggle / HuggingFace bundle self-contained for AI
and offline review. Every numerical / structural claim in the README
is now verifiable from inside the bundle without following a
github.com/blob/main/... link.
What's new
- release/metrics.json (root) + release/<tier>/metrics.json (per tier):
deterministic JSON view of LR AUC / AP / P@100 / Brier / conversion
rate / cohort-shift / cross-tier ordering medians, with JSON-path
back-references to release/validation/validation_report.json.
Built by scripts/build_release_metrics.py (--check mode for CI).
- release/docs/ vendored copies of generation_method.md,
channel_signal_audit.md, break_me_guide.md, feature_dictionary.md,
v1_acceptance_gates_bands.yaml, v2_decision_log.md, kept in sync
by scripts/sync_release_docs.py (--check mode for CI).
- release/docs/relational_table_schemas.csv: per-column documentation
for all 9 relational tables (64 columns), validated against live
parquet schemas in the new tests. Kaggle packager threads these
descriptions into resources[].schema.fields[].description so the
preview's previously-empty col__desc cells are now populated for
every relational table.
- release/claims_register_source.yaml (hand-edited) +
release/claims_register.{md,json} (rendered by
scripts/build_claims_register.py): 26 claims across nine categories,
each paired with backing artifact + JSON / YAML path. JSON output
carries a schema block so an agent landing on the file with no
context can interpret its own fields.
- schema.org/Dataset JSON-LD block injected into the <head> of both
Kaggle and HuggingFace preview HTML pages; shared
render_jsonld_dataset helper in scripts/_preview_common.py
HTML-escapes <, >, & inside the rendered JSON.
- Instructor HF README gets an "Agent-reviewable artifacts" section
pointing reviewers at docs/, claims_register.{md,json}, the
per-tier manifest, and feature_dictionary.csv. Cross-tier
metrics.json intentionally omitted from instructor (single-tier
dataset).
Both platform packagers extended
- scripts/package_kaggle_release.py and scripts/package_hf_release.py
copy the new root files (metrics.json, claims_register.*) and the
docs/ subtree into their upload trees so platform agents and
offline reviewers see the same files. Kaggle additionally
enumerates them in resources[] so the published "Data Files" panel
lists them.
- scripts/_release_common.py: new AGENT_REVIEWABLE_ROOT_FILES /
AGENT_REVIEWABLE_DOCS_DIR constants and
load_relational_column_descriptions() helper. SOURCE_TREE_BLOCK
updated in lockstep with the source-repo tree diagram in
release/README.md.
- release/README.md "What's inside" grows an "Agent-reviewable
artifacts" subsection mirroring the upload trees.
Tests
- 28 new cases across tests/scripts/test_sync_release_docs.py,
test_build_release_metrics.py, test_build_claims_register.py
covering happy path, idempotence, --check drift, missing-source
paths, invalid-YAML rejection, per-tier-skipping when bundle dirs
aren't materialised, and audit-sync against the real release/ tree.
- 4 new cases in test_preview_{kaggle,hf}_page.py pinning JSON-LD
presence in <head>, byte-equality of JSON-LD across HF variants,
and the SPDX-URL form of the license field.
- test_package_kaggle_release.py extended to assert per-table parquet
schemas now carry column descriptions and that the new
agent-reviewable root resources land in resources[].
- Committed previews (release/_preview_committed/*.html) regenerated.
Net: 1400/1400 tests pass + 5 publish-extra-gated skips; ruff clean
across the touched scripts.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* PR 7.2.1 self-review: actual claims verifier + drift guards
Hostile self-review of PR 7.2.1 turned up six gaps; this commit
addresses the highest-value ones.
(1) **scripts/verify_claims_register.py** — the verifier the original
PR was missing. Walks every claim in claims_register_source.yaml,
expands `<tier>` placeholders + brace/comma multi-paths, resolves the
JSON path inside the backing artifact, and confirms that numerics
embedded in the claim text match the resolved value within tolerance.
Catches numeric drift (claim says 0.879, artifact says 0.823),
broken paths, and resolution errors. Wired into CI as a new job.
(2) **scripts/build_release_metrics.py** no longer hardcodes
difficulty knobs — reads them live from
``leadforge/recipes/b2b_saas_procurement_v1/difficulty_profiles.yaml``
via a new ``load_difficulty_knobs`` helper. Each tier's metrics file
records a ``difficulty_knobs_source`` JSON-path pointer so the
recipe-yaml staying authoritative is documented in the artifact.
(3) **scripts/sync_release_docs.py** now refuses to clobber a
vendored destination whose mtime is newer than the source — the
sentinel that someone edited ``release/docs/X.md`` rather than the
canonical ``docs/release/X.md``. ``--force`` bypasses with an
explicit opt-in. Returns a ``_SyncResult`` dataclass instead of a
tuple. New ``release/docs/README.md`` explains the vendoring
direction loudly at the front of the directory.
(4) **JSON-LD constants single-sourced** in scripts/_preview_common.py
(``LICENSE_URL_MIT``, ``JSONLD_CITATION``, ``JSONLD_CREATOR``,
``JSONLD_VERSION``). Both preview scripts now import them instead
of duplicating the literal strings — no more drift surface between
Kaggle and HF previews on citation / recipe / seed.
(5) **CI integration** — new ``release-artifacts-sync`` job in
.github/workflows/ci.yml runs the four ``--check``-mode commands
(sync_release_docs, build_release_metrics, build_claims_register)
plus the new verify_claims_register. Without this job the audit-
sync was theatre.
(6) **Stronger validation of relational_table_schemas.csv** via new
tests/release/test_relational_table_schemas.py: descriptions must be
>=12 chars and non-TODO; dtypes from a closed vocabulary;
bundle_visibility in {public+instructor, instructor_only}; no
duplicate rows; parity with live parquet schemas.
Tests: 33 new cases across test_verify_claims_register.py (16 —
multi-path expansion, wildcard resolution, numeric extraction, drift
detection, and an audit-sync gate against the real tree),
test_relational_table_schemas.py (8), plus 4 new sync-script tests
for the orphan-destination guard. Existing tests updated for the
new _SyncResult shape and profiles_path parameter. 1425 passed
total + 5 publish-extra-gated skips.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* verify_claims_register: soft-skip gitignored bundle dirs
CI's release-artifacts-sync job failed on a fresh checkout because
``release/intermediate_instructor/manifest.json`` is gitignored — the
verifier was treating it as a hard error. Demote missing files under
any of the four gitignored bundle prefixes (intro/, intermediate/,
advanced/, intermediate_instructor/) to a soft skip; ``--strict``
upgrades them back to errors for release-readiness runs.
Same posture applied to the test failure in
``test_committed_claims_register_verifies_against_release_tree``,
which exercised the same path on Python 3.11 / 3.12 CI runners.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* .agent-plan: record PR 7.2.1 self-review pass
Append the six additional gaps closed in the post-PR hostile self
review (verifier, recipe-driven knobs, doc-vendoring guard, single-
sourced JSON-LD constants, CI integration, stronger schema CSV
validation) to the PR 7.2.1 entry.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 28b4c95 commit 2eeceec
39 files changed
Lines changed: 5523 additions & 163 deletions
File tree
- .github/workflows
- release
- _preview_committed
- docs
- huggingface-instructor
- huggingface
- kaggle
- scripts
- tests
- release
- scripts
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
65 | 88 | | |
66 | 89 | | |
67 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
48 | 81 | | |
49 | 82 | | |
50 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
38 | 82 | | |
39 | 83 | | |
40 | 84 | | |
| |||
92 | 136 | | |
93 | 137 | | |
94 | 138 | | |
| 139 | + | |
| 140 | + | |
95 | 141 | | |
96 | 142 | | |
97 | 143 | | |
| |||
218 | 264 | | |
219 | 265 | | |
220 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
221 | 284 | | |
222 | 285 | | |
223 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
38 | 112 | | |
39 | 113 | | |
40 | 114 | | |
| |||
115 | 189 | | |
116 | 190 | | |
117 | 191 | | |
| 192 | + | |
118 | 193 | | |
119 | 194 | | |
120 | 195 | | |
121 | 196 | | |
122 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
123 | 201 | | |
124 | 202 | | |
125 | 203 | | |
| |||
129 | 207 | | |
130 | 208 | | |
131 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
132 | 238 | | |
133 | 239 | | |
134 | 240 | | |
| |||
0 commit comments