Skip to content

test: fact-lifecycle edge cases for validFactsBeforeSession - #10

Draft
LaloLalo1999 wants to merge 2 commits into
mainfrom
oh/fact-lifecycle-tests
Draft

LaloLalo1999 wants to merge 2 commits into
mainfrom
oh/fact-lifecycle-tests

Conversation

@LaloLalo1999

@LaloLalo1999 LaloLalo1999 commented Jun 25, 2026 •

Copy link
Copy Markdown

What

Adds memswe-fact-lifecycle.test.ts — focused unit tests for validFactsBeforeSession / session-ordering helpers in memswe-smoke-runner-lib.ts.

Why

The existing memswe-valid-facts-before-session.test.ts (AMB-58) only checks inclusion at s1/s2/s3/s4 via task fixtures. It never exercises:

  • numeric vs lexical session ordering — sessionIndex does Number(), so s9 < s10 < s100. A naive string compare would regress this silently.
  • invalid_after_session expiry boundary (valid at the boundary, dropped after).
  • forget_requested_session exclusion boundary.
  • expected_use: forbidden / text-less fact exclusion.
  • empty/absent introduce list.

How

Pure-function assertions over synthetic TaskYaml objects — no FS, no mocks, no fixtures to drift. 7/7 green against main (8115dd4):

✓ test/suite/memswe-fact-lifecycle.test.ts (7 tests)
Test Files  1 passed (1)   Tests  7 passed (7)

Draft — part of the autonomous night maintainer loop; complements AMB-58.


View with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is enabled.

Adds memswe-fact-lifecycle.test.ts covering branches the existing
valid-facts test does not exercise:
- numeric (not lexical) session ordering: s9 < s10 < s100
- invalid_after_session expiry boundary
- forget_requested_session exclusion boundary
- forbidden / text-less fact exclusion
- empty/absent introduce list

Pure-function tests over synthetic tasks (no FS, no mocks). 7/7 green.
@blocksorg

blocksorg Bot commented Jun 25, 2026

Copy link
Copy Markdown

Mention Blocks like a regular teammate with your question or request:

@blocks review this pull request
@blocks make the following changes ...
@blocks create an issue from what was mentioned in the following comment ...
@blocks explain the following code ...
@blocks are there any security or performance concerns?

Run @blocks /help for more information.

Workspace settings | Disable this message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant