Repository navigation
refactor!: retire policy.json fallback - #405
Merged
Merged
Conversation
.devflow/policy.json is no longer parsed. At any source (default
branch, tracking copy, HEAD, worktree) whose project.json has no
`evidence`, an existing policy.json — whatever its bytes — makes that
source invalid, so the repository resolves `required` with the
`invalid-file` warning until its value moves to project.json
`evidence`. Presence is probed with the call each source already
makes (contents GET, cat-file blob, worktree lstat), so the argv
sequence is unchanged; the worktree file is never opened.
- delete parsePolicyBytes, POLICY_GRAMMAR_RE and serializePolicy and
the serializePolicy seam key (D-POLICY-JSON-RETIRED; rewrites
D-POLICY-SOURCE-PRECEDENCE to the end state)
- compliance --status migration hint states the rule and prints the
project.json line per value from serializeProjectSuggestion
- /implement's standard-policy remedy names project.json `evidence`
- tests: TP-45 (AC-39) and TP-46 (AC-40, incl. a src/ guard with a red
probe); fold fixtures restated in project.json
BREAKING CHANGE: a repository with only .devflow/policy.json resolves
`required` (WARN=invalid-file). Migrate
{"version":1,"evidencePolicy":"standard"} to
{"version":1,"evidence":"standard"} in .devflow/project.json.
Refs #394
State the end state of the policy.json retirement: `evidence` in .devflow/project.json is the only evidence-policy authority, and a committed .devflow/policy.json is never parsed — where project.json has no `evidence` its presence alone holds the repository at `required`. CLAUDE.md (Runtime data, Evidence policy), README, cli-reference, release-process, file-organization, the compliance-feature and installer-shadowing knowledge bases, and CHANGELOG [Unreleased]: a BREAKING entry with the exact migration, and the #392 entries rewritten so the one release reads consistently. Refs #394
Dogfood the policy.json retirement: commit .devflow/project.json with
{"version":1,"evidence":"required"} and remove .devflow/policy.json.
The root .gitignore gains the v6 carve-out line !.devflow/project.json,
byte-identical to what ensure-root-gitignore appends, so the file is
tracked without `git add -f`.
Refs #394
The byte-budget note cited .devflow/policy.json as this repository's required evidence policy; it now lives in .devflow/project.json. Refs #394
Pin the working-tree policy.json presence probe's edge arms (dangling symlink and directory present, ENOTDIR absent, EACCES present), and correct stale comments: resolve() makes at most three gh calls, the tracked-paths list names the retired policy file, the blob buffer note names project.json. Co-Authored-By: Claude <noreply@anthropic.com>
Matches the PR's vocabulary for the retired .devflow/policy.json (RETIRED_POLICY_FILE, retiredPolicyHint). The field is CLI-only and never reaches the settings line.
The resolver's MAX_POLICY_BYTES was an alias of the shared parser's bound for the project.json read; use projectConfig.MAX_CONFIG_BYTES directly, as resolve-settings.cjs does, and drop the alias export. project-json.test.ts pins the 4096 bound; the resolver's oversize tests keep the behaviour covered.
post-install DEVFLOW_POLICY_LINE JSDoc names D-POLICY-JSON-RETIRED (emitted gitignore bytes unchanged); release-process lists a committed retired policy.json, where project.json has no evidence key, among the sources that make the policy required.
Owner
Author
Test Plan Evidence — 9fc088fVerified 2/2: VERIFIED-CI 2, ATTESTED-LOCAL 0, UNVERIFIED 0, STALE 0, FAILED 0, INDETERMINATE 0
|
This was referenced Sep 30, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR7 of epic #387 (plan
.devflow/docs/design/per-repo-config-layer-master.2026-09-27.md, "PR7" section)..devflow/policy.jsonis no longer parsed: at every source (default branch, tracking, HEAD, worktree) whereproject.jsonhas noevidencekey, an existingpolicy.jsonresolvesrequiredwithinvalid-file, whatever it says; neither file present is unchanged.parsePolicyBytes,POLICY_GRAMMAR_RE,serializePolicyand their seam keys are deleted, and a guard oversrc/keeps them out. Presence reuses each source's existing call, so resolver argv is unchanged and the output line format is unchanged.Changes
parsePolicyBytes,POLICY_GRAMMAR_RE,serializePolicyand their seam keys fromsrc/assets/scripts/resolve-evidence-policy.cjs/src/core/evidence-policy.ts; add a source guard oversrc/to keep them out.project.jsonhas noevidencekey andpolicy.jsonis present at that source, resolverequiredwithWARN=invalid-file— the file's contents are never parsed.compliance --statushint no longer implies the file is read; it prints theproject.jsonequivalents instead./implement's stop remedies now tell teams to commit.devflow/project.json{"version":1,"evidence":"standard"}rather than editingpolicy.json..gitignorecarve-out and uninstall keep-list forpolicy.jsonare unchanged.D-POLICY-JSON-RETIREDadded;D-POLICY-SOURCE-PRECEDENCErewritten.{"version":1,"evidencePolicy":"standard"}→.devflow/project.json{"version":1,"evidence":"standard"}, alongside feat: committed .devflow/project.json + resolver --settings, narrow-only switches, publication ceiling #392 (project.json), since the release was held and both ship together..devflow/project.json{"version":1,"evidence":"required"}, deletespolicy.json, and commits the v6!.devflow/project.jsongitignore line.Breaking Changes
refactor!: any repo still relying on.devflow/policy.jsoncontent (without aproject.jsonevidencekey) now resolvesrequiredregardless of what the file said, instead of honoringstandard. On this branch the resolver printsrequired SOURCE=invalid WARN=invalid-file,pr-changes-policybecausemainstill has onlypolicy.json; after merge it resolvesrequired SOURCE=filewith no warning.Acceptance Criteria
policy.jsonsayingstandardwith noproject.jsonevidencekey resolvesrequired.project.jsonresolves exactly as it did in PR5.Pins Changed
evidence; every expected line unchangedrequired SOURCE=file→required SOURCE=invalid WARN=invalid-filestandard SOURCE=worktree WARN=remote-unavailable→required SOURCE=invalid WARN=remote-unavailable,invalid-file__proto__row → duplicated evidence keySOURCE=file→SOURCE=invalid WARN=invalid-file/complianceDefault/; new 5-line hint; project.json fixtures (online log 3 calls → 2)Testing
Coverage moves onto
project.jsonfixtures across the resolver, project-json, cli-seam, ticket-gate, implement-flow and scripted-shim suites per the pins table above. CI is the verification method for both ACs; no manual steps.Related Issues
Closes #394
Test Plan