You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The shape reading, at three depths and its controls. Depth-agnostic is
2808
+
// the whole point: a repair that merely allowed ONE extra segment passes
2809
+
// the first two of these and fails the third.
2810
+
assert(owners('packages/cli/src/commands/lint.ts')==='["packages/cli"]',`flat: one segment ⇒ the package dir — got ${owners('packages/cli/src/commands/lint.ts')}`);
`three levels deep reads the same way — a fix that hard-codes ONE optional group segment fails HERE, which is why the reading is a walk and not a wider pattern — got ${owners('packages/a/b/c/src/x.ts')}`,
2818
+
);
2819
+
assert(owners('packages/drivers/driver-sql/README.md')==='[]','control: a path with no `src/` segment owns nothing — otherwise the three positives above would hold for every file in the repo');
2820
+
assert(
2821
+
owners('packages/cli/bin/os.mjs')==='[]',
2822
+
'control: `bin/**` is still NOT read — WHICH roots ship is #16692\'s axis and this card must not silently close it; a fix that reddened here would be answering a different card',
2823
+
);
2824
+
assert(owners('scripts/check-changeset-no-major.mjs')==='[]','control: outside `packages/` there is no owner at all');
2825
+
assert(owners('packages/src/x.ts')==='[]','control: the owner must be at least `packages/<something>` — `packages` itself is not a package');
2826
+
assert(owners('packages/cli/src')==='[]','control: a path that IS `src` is not a path INSIDE `src/` — the walk stops one short of the end');
2827
+
2828
+
// The multi-candidate case, which this repo really contains, and the
2829
+
// reason the walk resolves SHALLOWEST first. `packages/create-objectstack`
2830
+
// ships a scaffold template that carries its own `package.json`
2831
+
// (`objectstack-blank`, private, not a workspace member), and the template
2832
+
// has a `src/` of its own. Resolving to the NEAREST manifest would name
2833
+
// the private template and DROP the real package — a regression against
// THE LEG THIS CARD IS ABOUT. Byte for byte the assertion the flat leg
2856
+
// has carried since #16055, with the package one directory deeper.
2857
+
constnestedPatch=levelOf(nestedRepo('patch'));
2858
+
assert(
2859
+
nestedPatch.touched.packages.includes(NESTED),
2860
+
`end to end: a nested package's src moved must NAME the package from its own manifest — got ${JSON.stringify(nestedPatch.touched)}`,
2861
+
);
2862
+
assert(
2863
+
nestedPatch.result.verdict==='enforce',
2864
+
`end to end: a real diff that moves ${NESTED_DIR}/src/** and grades it \`patch\` under a \`yes\` declaration is REFUSED — got ${nestedPatch.result.verdict}`,
2865
+
);
2866
+
assert(renderLevel(nestedPatch.result).exitCode===1,'and it EXITS 1 — the exit code is what becomes the check-run conclusion, and a verdict name CI never reads is not a refusal');
`control: the same nested diff graded \`minor\` PASSES while still being SEEN — so the refusal is about the level, not about the depth — got ${JSON.stringify(nestedMinor.touched)} / ${nestedMinor.result.verdict}`,
2879
+
);
2880
+
assert(renderLevel(nestedMinor.result).exitCode===0,'and the two nested legs differ in EXIT CODE, one word apart');
2881
+
2882
+
// CONTROL 2, the flat leg, re-driven HERE. #16055's assertion lives in
2883
+
// its own battery; re-stating it inside this harness is what makes the
2884
+
// nested red above readable as a WIDENING rather than as a gate that
2885
+
// stopped discriminating.
2886
+
constflat=levelOf(
2887
+
makeRepo(
2888
+
{'packages/cli/package.json': JSON.stringify({name: '@objectstack/cli',version: '0.0.0'}),'packages/cli/src/commands/lint.ts': 'export const before = 1;\n'},
2889
+
{'packages/cli/src/commands/lint.ts': 'export const after = 2;\n',[CS]: '---\n"@objectstack/cli": patch\n---\n\nbody\n'},
`control: the FLAT leg still reds in this same harness — a nested red beside a flat green would mean the reading moved rather than widened — got ${flat.result.verdict}`,
2895
+
);
2896
+
2897
+
// CONTROL 3, the nonsense leg: a diff that publishes nothing must stay
2898
+
// green under the very same `yes`. An implementation that simply always
2899
+
// enforced would satisfy every positive above and fail only here.
`control: a diff that moves no published source is still not this gate's business under a \`yes\` — got ${JSON.stringify(nonsense.touched)} / ${nonsense.result.verdict}`,
2909
+
);
2910
+
2911
+
// ⭐ THE NEW FAILURE MODE. Widening the shape means nested paths now
2912
+
// MATCH, so a nested dir whose manifest cannot be read has somewhere to
2913
+
// land. Before this change it landed in NEITHER set — the exact shape
2914
+
// #4690 forbids, and the one the filing card names: the gate could not
2915
+
// report a limb it never grew. `packages/mystery` pins this for a flat
2916
+
// dir in the battery above; this pins it at depth.
'the invariant the widening owes: a path that MATCHES the shape lands in exactly one of the two sets, never in neither — landing in neither is the whole finding this battery closes',
'and the tick PRINTS it — an offender that could not be seen must be stated beside the green, or the green is the same silent pass this card is about',
0 commit comments