AGENT SKILL
fix-nocturne-seed-invariants
Use when Nocturne domain tests fail due to seed data timeline violations (e.g., escalation timestamp after acknowledgment) or to validate that nc_seed_* constants satisfy engine preconditions before running the suite.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- fix-nocturne-seed-invariants
- description
- Use when Nocturne domain tests fail due to seed data timeline violations (e.g., escalation timestamp after acknowledgment) or to validate that nc_seed_* constants satisfy engine preconditions before running the suite.
03 SKILL.md 正文
Fix Nocturne Seed Invariants
Nocturne test failures often stem from seed data (nc_seed_* constants) violating temporal invariants enforced by the escalation engine.
- Identify the failing test: Run
bunx biome check --writeand the specific test suite to isolate the assertion error. - Inspect the invariant: Check
src/lib/nocturne/escalation.ts. The guardif (!incident.acknowledgedAt)means escalation timers only fire for unacked/snoozed incidents. - Verify seed timestamps: Open the seed file and compare
lastEscalatedAtagainstacknowledgedAtfor everyNocturneIncident.- Rule:
lastEscalatedAtmust be strictly beforeacknowledgedAt. - If
lastEscalatedAtis null, it is treated astriggeredAt, which is also acceptable but must precede any later events.
- Rule:
- Reorder the seed: Edit the seed constant so the escalation event (
lastEscalatedAt) fires before the acknowledgment event (acknowledgedAt). Do not modify the engine logic to accept invalid seeds. - Validate tier consistency: If the test uses multi-tier policies, ensure the number of ticks in the test matches
N-1for anN-tier policy, where each tick waits the current tier'swaitMinutes. - Run the full suite: Execute
bun test src/lib/nocturneto confirm all 360+ tests pass. - Typecheck: Run
bunx tsc --noEmitinsrc/to ensure no type regressions.
04 同仓库更多 Skills
valid-skill
A valid skill for testing purposes.
★ 0
unknown-field
A skill with an unknown frontmatter field.
★ 0
nested-child
Nested skill should be ignored.
★ 0
root-skill-preferred
Root skill should win.
★ 0
no-frontmatter
暂无简介
★ 0
child-skill
A nested skill in a subdirectory.
★ 0