You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow Rule authors to select guidance with case-sensitive literal fileContains conditions evaluated against text successfully observed by Read. Keep File observations runtime-owned and separate from path-only Working context, and require globs plus fileContains to match the same observation.
Acceptance criteria
Scalar and array declarations are trimmed, deduplicated exactly, preserve case and multiline text, and use literal substring matching with OR semantics.
A declared field with no valid literals logs one warning and makes the entire Rule fail closed.
Content-only matching works, while combined globs and fileContains conditions require one File observation to satisfy both and remain one family under match: any|all.
Successful text Reads contribute only returned file text, excluding wrappers and line-number prefixes; continuation and truncated Reads contribute only their returned slice.
Binary, image, PDF, and otherwise unparseable file Reads are path-only; directory Reads and failed Reads contribute no File observation.
File observations are retained monotonically for the resident session without filesystem scanning or historical tool-event replay.
Existing initial-turn durable Rule delivery remains functional and the full repository verification suite passes.
Implemented in 1d4504d (feat(rules): fileContains matching with observation-time admission).
Scalar/array declarations trimmed, exact-deduped, case-preserved, multiline literals with OR semantics: src/rule-metadata.test.ts:84, OR across literals in src/rule-filter.test.ts:400
Declared-but-invalid field warns once and fails the rule closed: src/file-contains-warning.test.ts, src/rule-filter.test.ts:392
Content-only matching and same-observation globs+fileContains family (one condition in match:any|all): src/rule-filter.test.ts:328-390
Read text excludes wrappers/line prefixes; continuation and truncated reads contribute only the returned slice: src/file-observation-read.test.ts
Binary/image/PDF/unparseable reads path-only; directory reads no observation: src/file-observation-read.test.ts:34,40,45
Observations retained monotonically for the resident session, no filesystem scanning or historical tool-event replay: src/file-observation-context.test.ts, src/observation-admission.test.ts:35
Initial durable delivery unchanged; full suite green (lint, tsc, 527 tests).
Activity
frap129 commentedon Aug 30, 2026
Implemented in 1d4504d (feat(rules): fileContains matching with observation-time admission).
src/rule-metadata.test.ts:84, OR across literals insrc/rule-filter.test.ts:400src/file-contains-warning.test.ts,src/rule-filter.test.ts:392globs+fileContainsfamily (one condition in match:any|all):src/rule-filter.test.ts:328-390src/file-observation-read.test.tssrc/file-observation-read.test.ts:34,40,45src/file-observation-context.test.ts,src/observation-admission.test.ts:35