Repository navigation
fix(shard-engine): correct the RELATION_EXISTS_KEY reservation claim - #386
Conversation
The comment said the codegen reserved-name guard blocks __-prefixed columns. It does not: FIELD_NAME_RE is /^[A-Za-z_$][\w$]*$/u, which admits _ and so admits __relationExists itself, and WhereInput's index signature treats every unrecognised key as a field. A table declaring that column would have a filter on it read as the marker. Also regenerates examples/payment-demo, which had been missing the usageEvents.mode column @lunora/payment added, and records two plan updates: 313's retention decision is amended to say what shipped, and 314 files the NLP library every Worker carries. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP
✅ Deploy Preview for lunorash ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you for following the naming conventions! 🙏 |
|
Thank you for confirming the Contributor License Agreement! 🙏 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (1)
WalkthroughThe PR updates ChangesRelation exists field documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #386 +/- ##
========================================
Coverage 87.09% 87.09%
========================================
Files 1172 1177 +5
Lines 63383 63567 +184
Branches 15447 15330 -117
========================================
+ Hits 55202 55365 +163
- Misses 7654 7680 +26
+ Partials 527 522 -5
🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Comparing Footnotes
|
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Closes the small findings left after #375, and files the one worth its own plan.
The last false comment from that thread
packages/shard-engine/src/where-types.tsclaimed:There is no such guard. Codegen's
FIELD_NAME_REis/^[A-Za-z_$][\w$]*$/u, which admits_and therefore admits__relationExistsitself, andWhereInput's index signature treats every unrecognised key as a field — so a table declaring that exact column would have a filter on it read as the EXISTS marker.This was the ninth such comment found across the plan-265/313 work and the only one left standing, kept back at the time because
RELATION_EXISTS_KEYis a where-tree key rather than a stored field, so the failure mode differs from the ones being fixed. The comment now states the real situation and says where a guard would belong (codegen's field-name validation, next to the other reserved names) rather than asserting one exists. No behaviour change.was generating stale code
@lunora/paymentaddedusageEvents.mode(v.optional(v.string())) and the example's_generatedfiles were never regenerated — verified: nomodein eitherdataModel.tsordrizzle.shard.ts. Surfaced during the plan-265 work and deliberately kept out of that diff to keep it honest. Regenerated here: 3 insertions, exactly the missing column.Examples are what people copy, so a shipped example that disagrees with its own schema is worth the one command.
Two plan updates
313 §4.4 amended. It read "Retention is explicit, not clever … No silent deletion of anything", and that is not what shipped —
backupRetainstill deletes inside the cron run. It is safe (it prunes only snapshots carrying its own cron expression and keeps anything ambiguous) but narrower rather than explicit. The decision now says so, points at §10 for the reasoning, and names WS4 as the work that would make it true. Better than leaving a plan that promises a verb the code does not provide.314 filed. Every Lunora Worker ships
compromise, an English NLP library, because@visulima/redacthard-depends on it andobservability/src/request-log.tsimports redact forredactArgs— whichdatabase-telemetry.tsandcontext-telemetry.tsboth call, so it is reachable from any app that logs. Wave 20 measured ~606 KiB raw, larger than any first-party package. It had been living as prose in a README notes section, which is exactly how the Wave-13 rows rotted.The plan's STOP condition is that redaction must not get weaker — it is a security path, so characterisation tests come first and the gate is the byte count in
bundle-meta.json, not the shape of the source.Verification
@lunora/shard-engine1040 tests,lint:typesandlint:eslint --max-warnings=0clean, Prettier clean across the touched files andplans/. The code change is comment-only; the example change is generated output.🤖 Generated with Claude Code
https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP
Summary by CodeRabbit