Skip to content

feat(apps): bind performance campaign approvals to frozen gate bytes - #787

Draft
Inference1 wants to merge 1 commit into
InferMatrixLab:mainfrom
Inference1:feat/freeze-campaign-intake-gate
Draft

Inference1 wants to merge 1 commit into
InferMatrixLab:mainfrom
Inference1:feat/freeze-campaign-intake-gate

Conversation

@Inference1

@Inference1 Inference1 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Governing Issue and delivery slice

Refs #606

The Draft authorization permits maintainers to review this file-backed slice and decide its ordering. Implementation delegation and merge ordering are pending.

Anchors touched: none

Problem

The selected task intake snapshot identifies a local acceptance document by its reference and normalized acceptance fields. On main at 7626c58f, a CPU campaign still started after optimization.model changed in the selected file after approval. Its five acceptance values were identical, so the approved brief ID still matched.

What

  • Include the SHA-256 of a local frozen gate in the approved brief and retain it in the intake record.
  • Check the current source at approval and at campaign start. A different digest requires reselection and fresh approval before a new campaign can start.
  • Document the confirmation path and exercise it through the CLI.

Why needed

An approval should authorize the document version the user reviewed. Documents with the same thresholds can describe different experimental conditions. Binding the approval to the selected bytes keeps an older confirmation from authorizing activity after the selected file changes. The digest in the retained record identifies the source version used at launch.

Design and implementation

The Apps task-input reader computes the digest from the same bounded bytes used to validate the YAML. Intake adds it to the selected gate snapshot and includes it in the existing canonical brief ID. The existing snapshot check handles invalidation on an edited source or a legacy snapshot without a fingerprint. Issue-backed acceptance and Harness callers use their existing paths.

#706 is already on main and shares the approval and intake-record boundary with this change. It writes a plan/intake-<sha256>.json receipt containing the digest, revision and brief ID of the retained intake.json. This Draft adds selected_gate.sha256 inside that intake record. It reuses the receipt format and introduces no Harness or plan interface changes. As recorded in the scope discussion, confirmation from the #706 author about any follow-up overlap or ordering is still pending.

Checks and dependencies

The signed candidate merged cleanly in a local worktree against main at 01333d70e3c8b33f940b844b8569d96b39388a83. The tested tree matches GitHub's merge ref refs/pull/787/merge. Ruff and the PR reference checker passed. Python 3.12 passed 347 tests and 43 subtests across intake, task input, module boundaries and the video validator added on that base.

The regression scenarios cover an unchanged approved file, changed bytes with identical acceptance fields, a stale approval reply that leaves the record intact, and a successful launch after reselection and approval. They also exercise older snapshots without a digest. Reproduce the targeted scenarios with python -m pytest -q tests/apps/test_task_intake.py -k campaign_binds_the_exact_frozen_gate.

ruff check src tests tools
python -m pytest -q tests/apps/test_task_intake.py tests/apps/test_task_input.py \
  tests/repository/test_target_module_import_gate.py tests/repository/test_module_boundaries.py \
  tests/benchmark/test_video_quality.py
  • The full suite in a clean Linux Python 3.12 environment passed 8,077 tests and 677 subtests, with 82 skips and no failures (python -m pytest -n 6 -rs). The skips include browser, platform and hardware tests. An earlier run with the shared runtime was interrupted after browser temporary-directory and subprocess errors.
  • The wheel built from the tested merge tree passed the repository's isolated installed-package smoke check under Python 3.10 and 3.11.
  • GitHub check results are tracked separately from these local runs.

Knowledge authorship declaration

{
  "schema_version": 1,
  "head_sha": "34105c10c126013d07ea6242f4bcb6b96fda2a29",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Codex",
      "model_id": "unknown",
      "effort": "unknown",
      "role": "author"
    }
  ]
}

Remaining work and Issue closure

This Draft is available for code feedback. Before marking it ready, record the dependency decision and implementation delegation on #606. Independent formal review and the required checks apply to the resulting PR head. Goal acceptance remains with the upstream owner.

Fingerprint the validated frozen gate source and check it before accepting the brief or starting a campaign. Retain the fingerprint with the approved intake record.

Agent-assisted-by: Codex (author)
Signed-off-by: Inference1 <3617237115@qq.com>
@Dong1017 Dong1017 added the area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters label Nov 27, 2026

Copy link
Copy Markdown
Collaborator

inferRSI, acting for @amy-why-3459.

Reviewed base 01333d70e3c8b33f940b844b8569d96b39388a83 and head 34105c10c126013d07ea6242f4bcb6b96fda2a29 (commit range 01333d7 → 34105c1).

I am not Approving this draft head. The #606 authorization (comment 7222738685) is only a review channel: implementation assignment and merge ordering are still pending @jiangkuaixue123's confirmation versus #706, and the PR itself says formal review applies after that is recorded.

On the file-backed slice itself, the change matches the authorized scope. selected_gate.sha256 is taken from the same bounded bytes used to validate the YAML (task_input.py _load_document / preview(..., include_source_digest=True)). _evaluate_gate includes that digest in the snapshot equality check, so a byte change with identical acceptance fields, or a legacy snapshot without a fingerprint, drops the brief and launch state and requires reselection and a new approval. answer_command re-evaluates the gate before a brief approval, which is what produces the tested stale_answer path. The parametrized test covers the cases required in the draft authorization. Accuracy/performance comparison experiments are not applicable (intake/approval binding only). I did not rerun the reported 8,077-test suite.

No code change is requested from this look; please record the #606 ordering decision before marking the PR ready, then request review on that head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants