Skip to content

feat(annotations): read target paths from the target's state - #158

Open
PiquelChips wants to merge 1 commit into
feat/ci-promote-apifrom
feat/ci-target-paths
Open

PiquelChips wants to merge 1 commit into
feat/ci-promote-apifrom
feat/ci-target-paths

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

A result stands for the checks in force on its target (#19). A worker runs a candidate's checks as the target's checks.toml defines them, but promotion matched results by the candidate's own copy. A candidate restoring an older checks.toml could therefore pick up a result run under the old definition.

A check's inputs now have a second list, target_paths, read from the state of the target the subject is on (its base acceptance, down any stack) rather than from its own tree. Workers declare checks.toml there; origin ci run keeps the revision's own copy, which is what it runs with. The spec hashes each list with its count, so a path read from the target never matches one read from the snapshot.

  • Format break: Inputs gains a field, so every statement that declares inputs gets a new encoding and id, and the spec and digest contexts move to 2026-11. Nothing is released, so no migration.
  • Behaviour change: a candidate that only edits checks.toml now has the target's result promoted, since the worker would run the same definition on the same files.
  • Cost: input_digest on snapshot paths only takes 38.6 µs; with a target path on a revision three deep in a stack, 62.9 µs. That's the four record reads down to the base acceptance, paid once per statement when digests are computed.
  • Proof: target_paths_are_read_from_the_base and target_paths_are_read_from_the_target, each failing without the change. The end-to-end test, results_stand_for_the_checks_in_force_on_the_target, comes with the worker.

Closes #19

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0917ec3-53e3-490d-b27f-6b4453d1b082
Commits

Reviewing files that changed from the base of the PR and between e40365a and e5ddb84.

Files selected for processing: 16

  • apps/origin-src/benches/annotations.rs
  • apps/origin-src/src/annotations/mod.rs
  • apps/origin-src/src/annotations/promotion.rs
  • apps/origin-src/src/cli.rs
  • apps/origin-src/src/index.rs
  • apps/origin-src/src/permissions.rs
  • apps/origin-src/src/queue/tests/mod.rs
  • apps/origin-src/src/tree.rs
  • apps/origin-src/src/workspace/annotate.rs
  • apps/origin-src/tests/http.rs
  • crates/origin-shared/benches/object.rs
  • crates/origin-shared/src/lib.rs
  • crates/origin-shared/src/object/mod.rs
  • crates/origin-shared/src/object/statement.rs
  • docs/design.md
  • docs/openapi.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/ci-target-paths branch 2 times, most recently from 8d55849 to 9bcc236 Compare November 22, 2026 18:54
A worker runs a candidate's checks as the target's `checks.toml`
defines them, but promotion matched results by the candidate's own copy.
A candidate restoring an older `checks.toml` could therefore pick up a
result run under the old definition.

`Inputs` gains a second list, `target_paths`, read from the state of the
target the record is on (its base acceptance, down any stack) rather
than from its own snapshot. The input digest hashes the snapshot's
paths, then the target's, and the spec hashes each list with its count,
so a path read from the target never matches one read from the snapshot.
`InputTrees` reads the target's state once, when first needed.

This is a format break: every statement that declares inputs gets a new
encoding and id, and the spec and digest contexts move to `2026-11`.
Nothing is released, so there's no migration.

The input digest on snapshot paths only takes 38.6 µs; with a target
path on a revision three deep in a stack, 62.9 µs: the four record reads
down to the base acceptance, paid once per statement.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: a result can stand for a checks.toml other than the target's

1 participant