Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/guard-core/src/intent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const MEC_CONSTITUTIONAL_REGEX =
export const SCOPE_ENVELOPES = {
docs: ['docs/', 'README', 'DOCS.md', 'CONTRIBUTING.md', 'LICENSE', 'FOR-'],
ci: ['.github/'],
core: ['apps/', 'packages/', 'src/', 'lib/'],
core: ['app/', 'apps/', 'packages/', 'src/', 'lib/'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add app/ to the default tier policy**

When changed-file analysis runs with the built-in policy, an App Router path such as app/api/vault/status/route.ts is now accepted by the core envelope here, but DEFAULT_POLICY still lacks an app/** EP-2 rule, so classifyFile(DEFAULT_POLICY, ...) falls through to Rule 5.2 as EP-3. In default-policy repositories this leaves scope: core App Router PRs deny-by-default tiered, and any intent validation error makes them fail-closed even though the divergence warning was removed.

Useful? React with 👍 / 👎.

infra: ['infra/', 'render.yaml', 'vercel.json', 'Dockerfile', 'docker-compose', 'netlify.toml'],
sentinels: ['sentinels/', 'agents/'],
labs: ['labs/', 'experiments/'],
Expand Down
20 changes: 20 additions & 0 deletions packages/guard-core/test/envelope.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';

import { inEnvelope } from '../src/index.mjs';

describe('scope envelopes', () => {
it('covers Next.js App Router paths under core', () => {
assert.equal(inEnvelope('core', 'app/api/vault/status/route.ts'), true);
assert.equal(inEnvelope('core', 'lib/vault-v2/store.ts'), true);
});

it('still covers legacy apps/ monorepo layout under core', () => {
assert.equal(inEnvelope('core', 'apps/terminal/api/route.ts'), true);
});

it('rejects paths outside the declared scope', () => {
assert.equal(inEnvelope('infra', 'app/api/vault/status/route.ts'), false);
assert.equal(inEnvelope('docs', 'lib/vault-v2/store.ts'), false);
});
});
Loading