pi-ext
bugabingas pi extensions
owned by bugabinga
fix(the-system): allow external path edits
445aa30e2064020c812306fc0973ba0c84194a2e
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (2)
extensions/the-system/__tests__/system.test.ts
Modified 85 85 describe(
"runtime bundle governance", ()
=> {
86 + it(
"does not govern mutations outside the detected project root",
async ()
=> {
87 + const project
= root();
88 + const outside
= path.
join(path.
dirname(project),
"outside.md");
92 + await preflightFileMutation(
95 + { path: outside, content:
"outside" },
86 103 it(
"allows valid new index candidates and blocks invalid layouts and metadata before approval",
async ()
=> {
87 104 const project
= root();
extensions/the-system/system.ts
Modified289 289 `The System cannot resolve project ownership: ${error instanceof Error ? error.message : String(error)}`,
292 + const candidate
= path.
resolve(cwd, input.path);
293 + const candidateRelative
= path.
relative(
root, candidate);
295 + candidateRelative
=== ".." || 296 + candidateRelative.
startsWith(
`..${path.sep}`)
|| 297 + path.
isAbsolute(candidateRelative)
292 300 let target
: string;
294 - target
= resolveGovernedPath(
root, path.
resolve(cwd, input.path));
302 + target
= resolveGovernedPath(
root, candidate);
295 303 }
catch (error) {
297 305 `The System rejected the governed path: ${error instanceof Error ? error.message : String(error)}`,