Skip to main content

Module policy_root_context

Module policy_root_context 

Source
Expand description

The optional root-context policy: no top-level CONTEXT.md enters the index. What: The optional mono/forbidden-root-context policy: a CONTEXT.md file at the repository’s top level must not enter the index or be checked. Why: This repository keeps no context files; agents read the source on every probe (doc/agent/domain.md). The rule and its finding are the installed wrapper’s (package/git-policy/repository/src/index.ts): only the top-level pathname counts, and removing the file is always allowed.

In TS you’d write (pseudocode):

// if (candidates.some(c => c.path === 'CONTEXT.md' && c.change !== 'deleted')) return [finding];

Constants§

ROOT_CONTEXT_CODE
The policy-local code of the finding.
ROOT_CONTEXT_MESSAGE
The message of the finding, as the installed wrapper words it.
ROOT_CONTEXT_PATH
The one pathname the policy forbids, relative to the repository’s top level.

Functions§

check_root_context
What: Check the lifecycle’s candidates for a top-level CONTEXT.md that is not a deletion. <F: RepositoryFacts> accepts any facts provider. Why: Only pathnames and change kinds are read, never content; at most one finding.