From 48bea9378269234d0f90e2585d581080f36a32f9 Mon Sep 17 00:00:00 2001 From: Vasilev Dmitrii Date: Thu, 20 Aug 2026 06:54:46 +0700 Subject: [PATCH] feat(tri): landed --file asserts a path, not only content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verifying a merged pull request, probing for CITED_NUMBERS returned ABSENT while research/CITED_NUMBERS_2026-08-20.md was on main. The tool was right and the question was wrong: --probe searches content, and a file rarely contains its own name. --file asserts existence on the default branch, reported as EXISTS/MISSING beside the content probes. Fifth way a landing probe lies — and the first fixable in the tool rather than in the caller. Closes #2269 --- cli/tri/src/prcheck.rs | 30 +++++++++++++++++++++++++++--- docs/NOW.md | 9 +++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/cli/tri/src/prcheck.rs b/cli/tri/src/prcheck.rs index 58d669871d..74bb2582e1 100644 --- a/cli/tri/src/prcheck.rs +++ b/cli/tri/src/prcheck.rs @@ -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, + /// 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, }, Ready { /// Pull request number. @@ -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(&[ @@ -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}."); diff --git a/docs/NOW.md b/docs/NOW.md index 8503833600..4526386477 100644 --- a/docs/NOW.md +++ b/docs/NOW.md @@ -1,3 +1,12 @@ +# 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 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 first real formal verdicts: fifo and mac PROVE (2026-08-20) Last updated: 2026-08-20