fix(update-system): allow writing-samples/README.md as system-owned file#562
fix(update-system): allow writing-samples/README.md as system-owned file#562msabihahmed wants to merge 2 commits intosantifer:mainfrom
Conversation
writing-samples/ is in USER_PATHS so users' personal samples are never
overwritten, but writing-samples/README.md ships from upstream as
documentation. The apply-time safety check flagged it as a SAFETY
VIOLATION because file.startsWith('writing-samples/') matched before
the SYSTEM_PATHS allowlist was consulted.
Add writing-samples/README.md to SYSTEM_PATHS, and short-circuit the
safety loop when a file appears verbatim in SYSTEM_PATHS so the
explicit allowlist takes precedence over USER_PATHS prefix matches.
Update DATA_CONTRACT.md to document the exception.
Closes santifer#549
|
Welcome to career-ops, @msabihahmed! Thanks for your first PR. A few things to know:
We'll review your PR soon. Join our Discord if you have questions. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFixes a path-ownership conflict by treating ChangesSystem Path Exception for Writing Samples
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
DATA_CONTRACT.md (1)
26-65:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
writing-samples/README.mdis absent from the System Layer table.The exception is noted in the User Layer row (line 21), but the System Layer table has no corresponding entry. An auditor reading only the System Layer section would have no record of this file being system-owned. Adding an explicit row makes the contract auditable from both directions.
📝 Proposed addition to System Layer table
| `docs/*` | Documentation | | `VERSION` | Current version number | | `DATA_CONTRACT.md` | This file | +| `writing-samples/README.md` | System-owned onboarding documentation for the writing-samples directory |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@DATA_CONTRACT.md` around lines 26 - 65, The System Layer table in DATA_CONTRACT.md is missing an explicit row for writing-samples/README.md; update the "System Layer (safe to auto-update)" table by adding a new row mapping `writing-samples/README.md` to its purpose (e.g., "Writing samples README — system-owned documentation") so the file is recorded in the system-owned list; edit the table where the other file rows (like `modes/_shared.md`) are defined to include this new entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@DATA_CONTRACT.md`:
- Line 21: The diff reclassifies writing-samples/README.md from USER_PATHS to
SYSTEM_PATHS in DATA_CONTRACT.md, which triggers the project rule that
user-layer reclassifications require explicit maintainer sign-off; get that
sign-off before merging by either (A) adding a maintainer approval comment on
the PR or (B) updating DATA_CONTRACT.md to include a documented exception entry
for writing-samples/README.md that includes a maintainer signature or
"Approved-by" line and date, and ensure the PR description references the
justification and links the maintainer approval; confirm the PR cannot be merged
without that explicit acknowledgement.
---
Outside diff comments:
In `@DATA_CONTRACT.md`:
- Around line 26-65: The System Layer table in DATA_CONTRACT.md is missing an
explicit row for writing-samples/README.md; update the "System Layer (safe to
auto-update)" table by adding a new row mapping `writing-samples/README.md` to
its purpose (e.g., "Writing samples README — system-owned documentation") so the
file is recorded in the system-owned list; edit the table where the other file
rows (like `modes/_shared.md`) are defined to include this new entry.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 73fa07d3-79e2-4fd7-88ae-66a4253f8c26
📒 Files selected for processing (2)
DATA_CONTRACT.mdupdate-system.mjs
…able The previous commit added the User Layer exception note but did not add the corresponding row to the System Layer table, leaving the contract auditable from only one direction. Add the explicit System Layer row so writing-samples/README.md appears in both tables. Refs santifer#549
What does this PR do?
Adds
writing-samples/README.mdtoSYSTEM_PATHSand short-circuits the apply-time safety check when a file appears verbatim in theSYSTEM_PATHSallowlist, so the explicit allowlist takes precedence overUSER_PATHSprefix matches.DATA_CONTRACT.mdis updated with a one-line note documenting the exception.Related issue
Closes #549
Type of change
Checklist
node test-all.mjsand all tests pass (65 passed, 0 failed, 15 pre-existing warnings)Notes
SYSTEM_PATHSlookup uses exact-stringArray.includes(), so only the explicitly-listedwriting-samples/README.mdis exempted — other files underwriting-samples/remain protected by the existingUSER_PATHSprefix check.USER_PATHSloop, ensuring the explicit allowlist always wins over prefix matches without changing behavior for any other path.Summary by CodeRabbit