Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions cli/tri/src/prcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ pub enum PrCmd {
/// older merges: probing pull request N with wording a LATER pull
/// request rewrote. Probe with the string as that pull request
/// introduced it, not as the file reads today.
#[arg(long = "probe", required = true)]
#[arg(long = "probe")]
probes: Vec<String>,
/// A path the pull request added, asserted to exist on the default
/// branch. Separate from --probe because a filename is not content:
/// probing for "CITED_NUMBERS" reported ABSENT while
/// research/CITED_NUMBERS_2026-08-20.md was present — the file simply
/// does not contain its own name.
#[arg(long = "file")]
files_present: Vec<String>,
},
Ready {
/// Pull request number.
Expand Down Expand Up @@ -93,14 +100,15 @@ pub fn run(cmd: &PrCmd) -> Result<()> {
number,
repo,
probes,
} => landed(*number, repo.as_deref(), probes),
files_present,
} => landed(*number, repo.as_deref(), probes, files_present),
}
}

/// Check that what the pull request introduced is present in the default
/// branch, file by file. Status is not content: a merged pull request whose
/// stack-mate was auto-closed leaves a list that reads as success.
fn landed(n: u64, repo: Option<&str>, probes: &[String]) -> Result<()> {
fn landed(n: u64, repo: Option<&str>, probes: &[String], files_present: &[String]) -> Result<()> {
let repo = match repo {
Some(r) => r.to_string(),
None => gh(&[
Expand Down Expand Up @@ -167,6 +175,22 @@ fn landed(n: u64, repo: Option<&str>, probes: &[String]) -> Result<()> {
absent.push(p.clone());
}
}
for f in files_present {
let exists = gh(&[
"api",
&format!("repos/{repo}/contents/{f}?ref={branch}"),
"--jq",
".name",
])
.is_ok();
if exists {
println!(" EXISTS {f}");
} else {
println!(" MISSING {f}");
absent.push(format!("file {f}"));
}
}

println!();
if absent.is_empty() {
println!("VERDICT: the content landed on {branch}.");
Expand Down
8 changes: 8 additions & 0 deletions docs/NOW.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# NOW -- landed can assert a path, not only content (2026-08-20)

Last updated: 2026-08-20

## landed can assert a path, not only content (Closes #2269)

- tri pr landed --file <path> asserts the path exists on the default branch, separately from --probe which searches content: probing for CITED_NUMBERS returned ABSENT while the file of that name was present, because a file does not contain its own name
- Fifth way a landing probe lies, and the first with a fix in the tool rather than in the caller's habits
# NOW -- the arXiv LUT count was the flip-flop count (2026-08-20)

Last updated: 2026-08-20
Expand Down
Loading