Skip to content

Read fixed attempt status and archived claims in Apps - #449

Merged
Dong1017 merged 1 commit into
InferMatrixLab:mainfrom
zengchuang-hw:codex/apps-371-fixed-attempt-view
Nov 15, 2026
Merged

Dong1017 merged 1 commit into
InferMatrixLab:mainfrom
zengchuang-hw:codex/apps-371-fixed-attempt-view

Conversation

@zengchuang-hw

Copy link
Copy Markdown
Contributor

Governing issue and delivery slice

Refs #371, step 6. Builds on the merged Apps views and Harness records migration in #425.

  • Python inferrsi.apps.api.read_attempt_view and CLI status --record-ref <record.json> --storage-config <storage.json> use the same read-only projection. An optional --assessment-ref <assessment.json> adds archived outcomes and their scopes for that exact record.
  • The view validates fixed bytes through the configured mounts, checks record and assessment identity, and keeps execution facts separate from claim outcomes. The legacy status --run-id and report routes use their existing run-directory reader.
  • This covers the fixed-status entry. The report, Dashboard/live and trace connections and the joint production CPU acceptance still follow.

Evidence

222 tests and 2 subtests passed on Windows across Apps, CLI, module boundaries and frozen legacy runs. The tests compare CLI and Python output, reject swapped revisions and invalid archived assessment identities, and read an older SQLite record with its matching archived assessment from a fresh process. Repository Ruff and staged diff checks passed.

Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)
@Dong1017 Dong1017 added area:harness Harness module: profile, A/B loop, quality gates, evidence reports kind:task Bounded delivery task with a delegated slice labels Nov 15, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS
Reviewed base 36440109d4a81ec33fdd2e5ac28449a7fd0ddea9 and head 542d04fd1f440e68445e83779b50c8e983d89a44.

Governing slice: #371 step 6 fixed-status entry only (report / Dashboard / trace / joint CPU acceptance explicitly deferred).

Verified:

  • read_attempt_view keeps execution facts separate from optional archived claims; mount-verified bytes via ArtifactReader / read_assessment; IdentityMismatch on swapped record or assessment revision; ArtifactIntegrityError on broken assessment semantic id.
  • CLI status --record-ref + --storage-config (+ optional --assessment-ref) shares the Python projection; mutually exclusive with --run-id; legacy status --run-id / report unchanged; PublicError maps to argparse exit 2.
  • Local tests/test_apps_assess.py 28 passed; ruff clean on touched paths.
  • Ready CI on head: full-check (3.10/3.11), installed-package (3.10/3.11), declarations, pr-references, dashboard-browser — all success.

No outstanding blockers for this bounded slice. Did not merge.

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS
Reviewed base 36440109d4a81ec33fdd2e5ac28449a7fd0ddea9 and head 542d04fd1f440e68445e83779b50c8e983d89a44. The scope is only the #371 step 6 fixed-status entry; report, Dashboard/live, trace and joint CPU acceptance are deferred, as the body says.

What I checked:

  • src/inferrsi/apps/views/attempt.py: the RecordRef shape and its JSON media type are checked first. The bytes are read through ArtifactReader with the configured mounts, and the record must be a v1 committed record. Every projected execution field, cleanup and candidate (nullable) is required by ExecutionRecordPayload in contract-v1.schema.json, so a missing field is correctly reported as ArtifactIntegrityError. An attempt_id / record_version mismatch against the ref raises IdentityMismatch.
  • With --assessment-ref, the archived assessment must match this exact record_ref, attempt_id, prepared_ref, protocol_digest and candidate. It is then rechecked with check_assessment_identity. Claim outcomes stay in assessment, separate from execution, and both refs are deep-copied, as the mutation assertion in the test shows.
  • CLI (arguments.py, cli.py L159-181): --run-id and --record-ref are mutually exclusive. The extra flags are rejected without --record-ref, and PublicError / ValueError end in argument_parser.error, i.e. exit 2, matching docs/operations.md. Legacy status --run-id and report keep their existing run-directory path.
  • Tests cover Python/CLI output equality, a swapped record revision, an assessment for another revision, a tampered verdict, the flag combinations, and a fresh-process read of the reassessed SQLite revision.
  • All 7 checks on this head are green. No blocking reviews on this head.

Optional, non-blocking: the CLI parses the ref and config files with json.loads. Using inferrsi._json_v1.decode would apply the same v1 JSON rules as the other fixed-ref inputs.

@zengchuang-hw

Copy link
Copy Markdown
Contributor Author

Thanks for the decoder check. I kept ordinary JSON formatting for the CLI's reference and trusted configuration files so callers can copy a ref from the formatted CLI output or save an indented configuration. The selected record and assessment bytes still pass through the strict v1 decoder, the pinned size and SHA-256 checks, and the record/assessment identity checks.

@Dong1017
Dong1017 merged commit 1373ef8 into InferMatrixLab:main Nov 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:harness Harness module: profile, A/B loop, quality gates, evidence reports kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants