Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rules/retention-policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const agePruningRule = defineRule({
'TTL must be a positive number',
],
},
impl: (state, events) => {
impl: (_state, events) => {
const event = events.find((e) => e.tag === RETENTION_AUDIT_REQUESTED);
if (!event) return RuleResult.skip('No retention audit event in batch');

Expand Down
4 changes: 2 additions & 2 deletions src/semantic.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* ```
*/
export function createSemanticIndex(db, options = {}) {
const { embed, prefix = 'chronos:', dimensions = 384 } = options;
const { embed, prefix: _prefix = 'chronos:', dimensions = 384 } = options;
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.prefix is still documented as a supported option (key prefix for chronicle nodes), but the function never uses it—now it’s explicitly aliased to _prefix. This makes the public API misleading and prevents scoping indexing/tracing to a specific key namespace. Either apply the prefix when reading from db.list() (e.g., filter by record key/prefix) or remove the prefix option from the API/docs.

Copilot uses AI. Check for mistakes.

if (typeof embed !== 'function') {
throw new Error('SemanticIndex requires an embed function: async (text) => number[]');
Expand Down Expand Up @@ -145,7 +145,7 @@ export function createSemanticIndex(db, options = {}) {
const queryVec = await embed(query);
const results = [];

for (const [id, entry] of vectors) {
for (const [_id, entry] of vectors) {
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop over vectors only uses the value; declaring _id suggests the key might matter. Consider using array elision for the unused Map key to make the intent clearer and avoid carrying an always-unused binding.

Suggested change
for (const [_id, entry] of vectors) {
for (const [, entry] of vectors) {

Copilot uses AI. Check for mistakes.
// Apply filters
if (startMs && entry.node.timestamp < startMs) continue;
if (endMs && entry.node.timestamp > endMs) continue;
Expand Down
Loading