Summary
Add a fast-check property test proving that freeze(agentId) followed by unfreeze(agentId) restores the agent to operational state.
What to do
- Create
src/observe/__tests__/freeze-registry.property.test.ts
- Use
fast-check (already a dev dependency)
- Test properties:
- For any agentId:
freeze(id) → isFrozen(id) === true
- For any agentId:
freeze(id) → unfreeze(id) → isFrozen(id) === false
- Freezing one agent doesn't affect another agent's state
- Run 100 iterations per property
Example structure
import fc from 'fast-check';
import { freeze, unfreeze, isFrozen } from '../freeze-registry';
describe('FreezeRegistry (property-based)', () => {
it('freeze then unfreeze restores operational state', () => {
fc.assert(
fc.property(fc.string({ minLength: 1 }), (agentId) => {
freeze(agentId);
expect(isFrozen(agentId)).toBe(true);
unfreeze(agentId);
expect(isFrozen(agentId)).toBe(false);
}),
{ numRuns: 100 }
);
});
});
Acceptance criteria
Helpful links
- Freeze registry:
src/observe/freeze-registry.ts
- fast-check docs: https://github.com/dubzzz/fast-check
- Existing property tests:
dashboard/web/src/utils/formatters.test.ts (for pattern)
Summary
Add a fast-check property test proving that
freeze(agentId)followed byunfreeze(agentId)restores the agent to operational state.What to do
src/observe/__tests__/freeze-registry.property.test.tsfast-check(already a dev dependency)freeze(id)→isFrozen(id) === truefreeze(id)→unfreeze(id)→isFrozen(id) === falseExample structure
Acceptance criteria
npx vitest run src/observe/__tests__/freeze-registry.property.test.tsHelpful links
src/observe/freeze-registry.tsdashboard/web/src/utils/formatters.test.ts(for pattern)