Repository navigation
refactor(app): share log query integer parsing and split the editor trigger field policy - #1477
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Two small cleanups from the quality pass, no behavior change.
app/api/log.ts,app/api/agent.ts,app/agent/api/index.ts) each carried the same 33-line integer query validation. One strict parser inapp/util/parse.tsnow serves all three: absent and null pass through, non-string types are rejected, only complete integer syntax is accepted, bounds are checked, and signed, zero and leading-zero inputs behave as before. Auth, level/component filtering and settings are untouched.editor-trigger-snapshot.tshad a complexity of 132 in one function. The field-level policy (what gets a value, what is omitted for references, agents and ambiguous aliases, scalar handling, inherited concurrency and order, case-preserved paths) moved toeditor-trigger-field.tswith its own tests. Snapshot collection still owns identity, category and path discovery. Complexity is 18 for the snapshot and 19 for the new descriptor helper; priority order and omission rules are unchanged.Tests were written first: 36 parser boundary cases and 16 field contract tests failed before the change. Focused suites are green (197 parser and route tests, 202 editor, action, notification and reload tests). The full pre-push gate passed on this head, including 100% backend coverage, build, Biome, Knip, Qlty and workflow checks.
Threat model for review: a self-hosted update manager with authenticated operators. Check that no log route accepts an integer it rejected before and that the editor emits the same field set for every trigger shape. Hostile local maintainers are out of scope.
Changelog
parseLogQueryIntegerand parser tests for absent, malformed, unsafe, signed, and zero-padded inputs.tailandsince.triggerFieldDescriptorand tests for trigger field policies.triggerFieldDescriptor.Concerns