mirror of
https://github.com/garrytan/gstack.git
synced 2026-12-01 20:34:25 +01:00
gstack-pr-wait ignores cancelled checks a newer pass replaced, and the npm git-dependency hint names allow-git (#4832)
`gstack-pr-wait` no longer blocks on a cancelled check that a newer run of the same check replaced, and the `DEPS_MISSING` stop names npm 12's `allow-git` setting when the lockfile installs a package from git. The docs audit that /gstack-ship launches also starts after a reviewer's install, and a refused launch no longer uses up its one retry. Nothing for you to do. Fixes #4807 and #4815; thanks to exGeni for both reports and the repro. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/red-team#1 reader=red-team
This commit is contained in:
1 parent
959df8ccc4
commit
8aafd408e2
16 files changed
+175
-23
No files matched your search
@@ -48,7 +48,8 @@
|
||||
* attempt reads one audit child's output and says whether the launch counts
|
||||
* against Step 14.5's attempt budget. A launch the child's install check refused
|
||||
* (an `INSTALL: fail` row, its last GSTACK_RESULT line a document-release
|
||||
* refusal, and no audit JSON) never audited, so it is not counted, once per
|
||||
* refusal, and no audit JSON beyond a blocked result that reviewed and updated
|
||||
* no file, CAPY-1) never audited, so it is not counted, once per
|
||||
* invocation (--state, the invocation's record); a second refusal is counted
|
||||
* and stops for the install fix (GST-391, gbrain #8084).
|
||||
*
|
||||
@@ -325,7 +326,8 @@ function main(argv: string[]): void {
|
||||
const lines = fs.readFileSync(file, 'utf8').split('\n').map(l => l.trim()).filter(Boolean);
|
||||
const last = lines.filter(l => l.startsWith('GSTACK_RESULT: ')).pop();
|
||||
const install = lines.find(l => /^INSTALL: fail\b/.test(l));
|
||||
const audited = lines.some(l => { try { const v = JSON.parse(l); return !!v && typeof v === 'object' && 'schema_version' in v; } catch { return false; } });
|
||||
const empty = (a: unknown) => Array.isArray(a) && a.length === 0;
|
||||
const audited = lines.some(l => { try { const v = JSON.parse(l); return !!v && typeof v === 'object' && 'schema_version' in v && !(v.status === 'blocked' && empty(v.files_reviewed) && empty(v.files_updated)); } catch { return false; } });
|
||||
if (!last || !/^GSTACK_RESULT: skill=document-release status=refused\b/.test(last) || !install || audited) { console.log('ATTEMPT: counted'); return; }
|
||||
let seen = 0;
|
||||
try { seen = Number(JSON.parse(fs.readFileSync(state, 'utf8')).not_counted) || 0; } catch { seen = fs.existsSync(state) ? 1 : 0; }
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
# GSTACK_INSTALL_VERDICT, so a reviewer's install never shadows it (GST-1161).
|
||||
# Each workflow install also writes its own record, <verdict>.for/<workflow>.json,
|
||||
# which admission tries when the shared verdict does not admit that workflow, so
|
||||
# another workflow's later install never drops it (GST-1233).
|
||||
# another workflow's later install never drops it (GST-1233), then, when a
|
||||
# review-voice install wrote the shared verdict, /ship's own record, which
|
||||
# covers the workflows /ship launches (CAPY-1).
|
||||
#
|
||||
# Admission (gstack-skill-start, after SESSION_KIND): an unattended session,
|
||||
# or an explicit GSTACK_SESSION_KIND=spawned session with GSTACK_CAPY=1,
|
||||
@@ -192,16 +194,25 @@ gstack_install_admission() {
|
||||
_gstack_ia_check
|
||||
# GST-1233: each install also keeps its own verdict per workflow, so when a
|
||||
# later install for another workflow replaced the shared one, this
|
||||
# workflow's own record still admits it; never after a failed ./setup, which
|
||||
# changed the checkout every record certified.
|
||||
_ia_own="${file%.json}.for/$skill.json"
|
||||
case "$skill" in ''|*[!A-Za-z0-9._-]*) _ia_own="" ;; esac
|
||||
case "$trailer" in "gstack: fail setup"*) _ia_own="" ;; esac
|
||||
if [ -n "$detail" ] && [ -n "$_ia_own" ] && [ -f "$_ia_own" ]; then
|
||||
# workflow's own record still admits it; when an install profile (a
|
||||
# reviewer's review-voice install) wrote the shared verdict, so does /ship's
|
||||
# own record, which a workflow /ship launches (document-release) runs under
|
||||
# (CAPY-1); never after a failed ./setup, which changed the checkout every
|
||||
# record certified.
|
||||
_ia_dir="${file%.json}.for"
|
||||
_ia_ship=""
|
||||
gstack_doctor_install_profile "$(gstack_install_verdict_field "$file" for)" && _ia_ship="$_ia_dir/ship.json"
|
||||
case "$skill" in ''|*[!A-Za-z0-9._-]*) _ia_dir="" ;; esac
|
||||
case "$trailer" in "gstack: fail setup"*) _ia_dir="" ;; esac
|
||||
if [ -n "$detail" ] && [ -n "$_ia_dir" ]; then
|
||||
_ia_m_file=$file _ia_m_detail=$detail _ia_m_fix=$fix _ia_m_code=$code _ia_m_status=$_ia_status _ia_m_trailer=$trailer
|
||||
file=$_ia_own _ia_status=ok
|
||||
_gstack_ia_check
|
||||
[ -z "$detail" ] || { file=$_ia_m_file detail=$_ia_m_detail fix=$_ia_m_fix code=$_ia_m_code _ia_status=$_ia_m_status trailer=$_ia_m_trailer; }
|
||||
for _ia_own in "$_ia_dir/$skill.json" ${_ia_ship:+"$_ia_ship"}; do
|
||||
[ -f "$_ia_own" ] || continue
|
||||
file=$_ia_own _ia_status=ok
|
||||
_gstack_ia_check
|
||||
[ -n "$detail" ] || break
|
||||
file=$_ia_m_file detail=$_ia_m_detail fix=$_ia_m_fix code=$_ia_m_code _ia_status=$_ia_m_status trailer=$_ia_m_trailer
|
||||
done
|
||||
fi
|
||||
[ -n "$detail" ] || { _ia_line="INSTALL_VERDICT: ok $trailer"; return 0; }
|
||||
[ "$_ia_status" = runtime ] || _ia_status=verdict
|
||||
|
||||
@@ -196,7 +196,8 @@ function noStopArg(raw: string | undefined): ShipReceipt['no_stop'] {
|
||||
if (raw === undefined) return undefined;
|
||||
const parsed = JSON.parse(raw.startsWith('@') ? fs.readFileSync(raw.slice(1), 'utf8') : raw);
|
||||
if (!Array.isArray(parsed)) throw new Error('--no-stop expects a JSON array of {class, reason, evidence}');
|
||||
const kept = parsed.filter(r => (NO_STOP_CLASSES as readonly string[]).includes(r?.class) || void process.stderr.write(`NO_STOP: dropped ${JSON.stringify(r?.class)} from --no-stop: not a current no-stop class (${NO_STOP_CLASSES.join(', ')}), so the receipt leaves it out (GST-2706)\n`));
|
||||
const current: readonly string[] = NO_STOP_CLASSES.filter(c => c !== 'scoped-fix-check');
|
||||
const kept = parsed.filter(r => current.includes(r?.class) || void process.stderr.write(`NO_STOP: dropped ${JSON.stringify(r?.class)} from --no-stop: not a current no-stop class (${current.join(', ')}), so the receipt leaves it out (GST-2706)\n`));
|
||||
return kept.length ? kept : undefined;
|
||||
}
|
||||
function git(args: string[], cwd?: string): string | undefined {
|
||||
|
||||
Reference in new issue
Block a user