Repository navigation
feat: make skill evolution host runs auditable - #477
haiyuan-eng-google merged 4 commits into
Conversation
|
@caohy1988, this PR completes the remaining host-contract items identified during the review of #395 and tracked in #397. The CI workflow from my fork is currently waiting for maintainer approval. When you have time, could you please approve the workflow run and review the PR? The focused skill-evolution test suites pass locally (142 tests), with full validation details included in the PR description. Thank you! |
|
@Beverly621 please help star the repo and thanks for contribution |
caohy1988
left a comment
There was a problem hiding this comment.
Reviewed commit 63d0332 against f5e03bd.
The built-in collection path keeps patch text and source together through the quality gate, and the host-contract documentation addresses the remaining #397 documentation items. The supported replacement-collector paths still have two confirmed compatibility/provenance defects detailed inline, so I recommend fixing those before merge.
Validation: 142 focused tests passed locally; pyink/isort and diff checks passed. I approved the pending workflow runs, and CI passed across Python 3.10–3.14, formatting, browser smoke, and package build. Additional mocked reproductions expose the replacement-path failures despite the existing tests passing. No live model calls were needed for these reproductions.
425dae3 to
1c8cd6d
Compare
caohy1988
left a comment
There was a problem hiding this comment.
Fresh full review of 1c8cd6d against f5e03bd, covering the entire three-file PR and the host-contract requirements in #397.
The previous signature regression and the simple reorder/filter/deduplication cases are fixed; the two earlier threads are resolved. The public collector signature matches the base. Fresh review and public-entry-point probes found two further P2 provenance defects: recycled object IDs can reuse discarded patches' sources, and shared string objects cannot distinguish source occurrences after a wrapper filters or reorders them. An independent validator confirmed both defects; details and targeted regression suggestions are inline.
Validation: 145 focused tests passed; the full local suite passed with 5,049 tests and 57 skips. Pyink/isort and diff checks passed. CI passed on this commit across Python 3.10–3.14, formatting, browser smoke, and package build. Additional checks covered concurrent runs and context restoration. Live model calls were not run; the defects are reproduced with model calls stubbed.
Please fix the two source-integrity cases before merging. The documented fallback for opaque replacement collectors is not included as a change request.
|
Both new provenance-integrity findings are addressed in The focused suites pass all 148 tests. The complete local run produced 4,931 passed and 74 skipped, with the four environment-restricted tests also passing when rerun outside the sandbox. Formatting and diff checks pass as well. The new CI run is currently waiting for maintainer approval. |
caohy1988
left a comment
There was a problem hiding this comment.
Full fresh review of d219ed4 against main f5e03bd, covering all three changed files and downstream host adapters.
All four findings from the earlier reviews are fixed. I independently reproduced the discarded-batch and shared-string cases successfully and resolved the remaining two threads.
One P2 remains: a wrapper around the SDK collector that reconstructs equal patch strings loses already-recorded host provenance. The inline comment includes the reproduced result. Please preserve that provenance before merging.
Validation: 148 focused tests passed; complete local suite 5,052 passed, 57 skipped; pyink, isort, and git diff --check passed. CI 33944366992 is green, including Python 3.10-3.14, browser smoke, formatting, and package build. The eight review passes completed, and the remaining finding received independent validation.
Other integration limits: moving collection to another thread requires propagating context, and host analysts remain responsible for verifying user corrections. Additional signature/context-cleanup regression tests and splitting the large test module are optional follow-ups. No code changes were made in this review.
caohy1988
left a comment
There was a problem hiding this comment.
Full fresh review of 09ff598 against main f5e03bd, covering all three changed files, the complete provenance flow, host adapters, and tests.
No actionable findings remain. All five findings from the earlier reviews are fixed. I reran the public-entry-point copied-string reproduction: the artifact now correctly records ["host", "builtin"]. The earlier shared-string and discarded-batch regressions also pass, and the public signatures remain unchanged. I resolved the last outstanding review thread.
Validation: 150 focused tests passed; full local suite 5,054 passed, 57 skipped; pyink, isort, and git diff --check passed. CI 33978636902 is green, including Python 3.10-3.14, browser smoke, formatting, and package build. Eight independent review passes completed. Additional probes covered concurrent and nested evolution, exception cleanup, Unicode patch text, mixed host failures, and quarantined late results.
Nonblocking integration limits: provenance is context-local. A host wrapper that creates a thread to invoke the collector must propagate context (for example, copy_context().run). The documented callback and same-context wrapper paths retain provenance; opaque replacement collectors and ambiguous copied text retain the deliberate builtin fallback, which is not proof of builtin authorship. Host callbacks remain responsible for verifying user corrections. These limits do not require expanding this PR into a new cross-thread or provenance-registration API.
Optional follow-ups are stronger default-source/context-cleanup assertions and separating the large test module. The requested all stability declaration matches issue #397 and does not break the inspected qualified imports. Approving this head.
…luators Version bump 0.5.1 -> 0.5.2 and the changelog cut for everything merged since v0.5.1 (2026-08-29), 19 commits. In the wheel: the versioned EvalBench import pipeline (#451-#453: immutable snapshots with the W0.4 failed-session contract, the version-pinned failed_sessions view, evalbench-score), the native agent_events snapshot writer (#464), the failure taxonomy frozen at G1 v0.1.0 and its span-level localisation layer with persisted span labels (#467, #470), the evaluator API unification behind PerformanceEvaluator with compatibility aliases (#123), and the canonical metric factories plus opt-in policy scorecard (#91). Repo side: skill-evolution host hooks and auditable patch provenance (#395, #477), the scheduled skill-evolution Cloud Run Job (#472), the OKF adapter example (#474), the AgentForensics Week 0 freeze and sealed preregistration (#435, #473), and the EvalBench demo and CLI-discoverability follow-ups. Entries the Unreleased section lacked are added in this cut: #91, #123 (its bullets move under Changed with the PR number), #395, #472, #474, #476.
…478) * chore(release): 0.5.2 — EvalBench snapshots, G1 taxonomy, unified evaluators Version bump 0.5.1 -> 0.5.2 and the changelog cut for everything merged since v0.5.1 (2026-08-29), 19 commits. In the wheel: the versioned EvalBench import pipeline (#451-#453: immutable snapshots with the W0.4 failed-session contract, the version-pinned failed_sessions view, evalbench-score), the native agent_events snapshot writer (#464), the failure taxonomy frozen at G1 v0.1.0 and its span-level localisation layer with persisted span labels (#467, #470), the evaluator API unification behind PerformanceEvaluator with compatibility aliases (#123), and the canonical metric factories plus opt-in policy scorecard (#91). Repo side: skill-evolution host hooks and auditable patch provenance (#395, #477), the scheduled skill-evolution Cloud Run Job (#472), the OKF adapter example (#474), the AgentForensics Week 0 freeze and sealed preregistration (#435, #473), and the EvalBench demo and CLI-discoverability follow-ups. Entries the Unreleased section lacked are added in this cut: #91, #123 (its bullets move under Changed with the PR number), #395, #472, #474, #476. * chore(release): file the skill-evolution bullets as repo-side scripts/skill_evolution.py is not in the wheel (which ships only src/bigquery_agent_analytics and src/bigquery_ontology), so the #395 and #397 entries move from Added to their own repo-side section, matching the Deploy section this cut already uses for #472.
Summary
Complete the remaining host-contract hardening tracked in #397 so hosted skill-evolution runs are both auditable and safer to integrate.
Changes
source: "builtin" | "host"on every quality-gated patch in*_patches.json.collect_patches() -> list[str]return contract and compatibility with hosts that replacecollect_patches.__all__and document the additive session-schema policy.correction_boundaries[*].correct_factas an unverified user hypothesis and verify it through tools before producing a patch.The non-string result handling and bounded analyst timeout described in #397 are already present on
main; this change covers the remaining provenance and stability/documentation items.Validation
pytest -q tests/test_skill_evolution.py tests/test_skill_evo_job_selection_regressions.py— 150 passedpsaccess and browser smoke port binding) were rerun outside the sandbox and all 4 passedpyink --check scripts/skill_evolution.py tests/test_skill_evolution.pyisort --check-only scripts/skill_evolution.py tests/test_skill_evolution.pygit diff --checkCloses #397