Skip to content

Commit 3e2c834

Browse files
Merge pull request #72 from StepenkoAnatoli/fix/stale-unknown-line
The correction landed and the sentence it corrected stayed
2 parents e3d2fb3 + fbd0ad7 commit 3e2c834

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

‎.github/workflows/collect.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ name: collect
9090
# Re-run the measurement instead of trusting this comment, which can go stale:
9191
# node research-kit/bin/disclosure.mjs --repository OWNER/REPO --run <id> --topic "..."
9292
#
93-
# What is NOT measured here: what a signed-in user with read access sees in the web UI,
94-
# which is a different surface from the REST API. Treat that as unknown rather than safe.
93+
# What the disclosure probe does NOT measure: the signed-in surface, because it is
94+
# unauthenticated by design. That was measured separately, and the answer is above - a
95+
# signed-in reader sees every dispatch input in the job log. Do not read a clean probe as
96+
# "nobody learns the subject".
9597
#
9698
# And the reason going private is not the reflex fix: per E-06, converting a GitHub Free
9799
# repository from public to private makes its protection rules and environment secrets

‎research-kit/test/collector-workflow.test.mjs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,30 @@ test('the anonymous disclosure table never appears without the signed-in caveat'
228228
`${name} prints the anonymous refusal table without saying what a signed-in reader sees`);
229229
assert.ok(/env:/.test(text) && /\blog\b/i.test(text),
230230
`${name} does not name the mechanism - the job log echoing a step's env: block`);
231+
232+
// And it must not still call the same thing unknown somewhere else in the file.
233+
//
234+
// The first version of this guard asked only whether the caveat appeared ANYWHERE, and
235+
// it passed a file that carried both: the correction near the top, and thirty lines
236+
// below it the original "treat that as unknown rather than safe", untouched and reading
237+
// as current. A reader reaching the second sentence would have believed it.
238+
//
239+
// A stale sentence surviving beside its own correction is the defect ADR-0035 names,
240+
// committed in the act of recording it.
241+
//
242+
// The second version was worse: it was VACUOUS. It tried to match "signed-in user" and
243+
// "unknown rather than safe" in one line-anchored expression, and those sit on separate
244+
// lines, so `[^\n]*` could never bridge them and nothing could ever fail it. Found by
245+
// running the red check, which is the only reason this comment is not describing a
246+
// guard that silently guards nothing.
247+
//
248+
// Quoting the superseded claim is allowed and is the house style; asserting it is not.
249+
// So the phrase may appear only on a line that also marks it as past.
250+
const stale = text.split('\n').filter((line) => /unknown rather than safe/i.test(line)
251+
&& !/used to|no longer|superseded|this used to say/i.test(line));
252+
assert.deepEqual(stale, [],
253+
`${name} still asserts the signed-in surface is unknown, in the same file that measures it:\n `
254+
+ stale.map((l) => l.trim()).join('\n '));
231255
}
232256
});
233257

0 commit comments

Comments
 (0)