Skip to content

friction: verify refreshed goal-autopilot markers against marker-free source #8103

Description

@ll7

Archetype Metadata

archetype: workflow
evidence_tier: smoke
linked_policy:
  - docs/ai/open-issue-contract-preparation.md

Goal / Problem

Make preparation verification accept a legitimate refresh of an existing goal-autopilot-preparation:v1 marker while still detecting any change outside the marker.

_verify_batch currently removes the new marker and compares the remainder with body_sha256. When the audited source body already contained an older marker, that digest includes the old marker, so a correct marker replacement is reported as content drift outside marker. In the 2026-08-30 live pass this produced 104 false failures; revision-history comparison independently proved every edited body preserved its non-marker content.

A duplicate search for the marker name plus content drift outside marker, verifier, and refresh terms found no issue for this exact defect.

Inputs

  • scripts/dev/prepare_open_issue_contracts.py: _MARKER_BLOCK_RE, _verify_batch, and plan digest fields.
  • tests/dev/test_prepare_open_issue_contracts.py verify/idempotence fixtures.
  • GitHub revision-history semantics are evidence only; tests must remain offline.

Scope

  • Define one canonical digest for content outside the versioned marker, or retain enough audited source content to strip the marker on both sides.
  • Verify first insertion, marker refresh, and an already-current idempotent body.
  • Continue to fail on duplicate markers, malformed marker boundaries, or any byte change outside the documented newline boundary.
  • Report a reason that distinguishes malformed markers from real non-marker drift.

Non-goals

  • No weakening to a whole-body equality check that ignores user content.
  • No network-dependent tests.
  • No change to packet classification or labels.

Acceptance criteria

  • Replacing one old well-formed marker with one new marker verifies successfully.
  • First insertion and idempotent re-verification remain successful.
  • A one-byte change before or after the marker fails.
  • Duplicate or unterminated markers fail with a specific reason.
  • The documented final-newline rule is deterministic and covered by tests.

Validation / Testing

uv run pytest tests/dev/test_prepare_open_issue_contracts.py -q
uv run ruff check scripts/dev/prepare_open_issue_contracts.py tests/dev/test_prepare_open_issue_contracts.py
uv run ruff format --check scripts/dev/prepare_open_issue_contracts.py tests/dev/test_prepare_open_issue_contracts.py
python -m compileall -q scripts/dev/prepare_open_issue_contracts.py tests/dev/test_prepare_open_issue_contracts.py
git diff --check

Dependency and terminal state

Blocked-by: #8080

Once the current-main gate clears, this is one local verifier/test pull request.

schema: goal_autopilot_preparation.v1
repository: ll7/robot_sf_ll7
issue: 8103
source_body_sha256: b9657856ca2d46809d4df14aee062383a5d6ffa0fc6fe9f1a040229815c8e001
source_comments_sha256: 
audit_schema: open_issue_contract_audit.v1
audit_digest: 3f3c51addec2c0ac8aad5ca07f84a63669ce53bf2603a0919267fd1bd198b7c6
audit_classification: blocked
next_action: resolve_named_blocker
authority: blocker_owner
execution_mode: blocker
preferred_worker: MaxRunner
expected_pr_runner_label: runner:max
implementation_admitted: False
state_ready_change_proposed: False
mutation_batch: open-issues-final-20260831

This packet is preparation evidence only. It never overrides live labels, exact claim state, branch state, typed dependencies, domain gates, compute authority, release authority, or scientific evidence rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions