Skip to content

fix(hooks): restrict prompt entity injection types#797

Open
NicholaiVogel wants to merge 1 commit into
mainfrom
nicholai/prompt-entity-selector
Open

fix(hooks): restrict prompt entity injection types#797
NicholaiVogel wants to merge 1 commit into
mainfrom
nicholai/prompt-entity-selector

Conversation

@NicholaiVogel
Copy link
Copy Markdown
Collaborator

Summary

  • restrict prompt-submit entity injection to person and project entities
  • keep possessive normalization and longest-span selection while filtering generic one-token entity names
  • mirror the selector behavior in daemon-rs and add TS/Rust regressions for disallowed entity types

Validation

  • bunx biome check platform/daemon/src/hooks.ts platform/daemon/src/hooks.prompt-submit.test.ts
  • bun test platform/daemon/src/hooks.prompt-submit.test.ts
  • cargo test -p signet-daemon prompt_submit
  • bun run build:signetai
  • signet daemon restart --no-sync
  • live hook matrix: signet prompt context and signets prompt context inject; projects roadmap, agents are useful, tools setup, claude code connector setup, and context stay silent

Notes

  • No database migrations.
  • No public API contract change; this narrows prompt-submit entity selection policy.
  • nicholais favorite pens currently resolves the person entity but returns no-aspect-hit because the clean pen fact is not represented as a current Nicholai ontology attribute.

PR Readiness (MANDATORY)

  • Spec alignment validated (INDEX.md + dependencies.yaml)
  • Agent scoping verified on all new/changed data queries
  • Input/config validation and bounds checks added
  • Error handling and fallback paths tested (no silent swallow)
  • Security checks applied to admin/mutation endpoints
  • Docs updated for API/spec/status changes
  • Regression tests added for each bug fix
  • Lint/typecheck/tests pass locally

Migration Notes (if applicable)

  • Migration is idempotent
  • Daemon Rust parity reviewed or explicitly N/A
  • Rollback / compatibility note included in PR description

@PR-Reviewer-Ant
Copy link
Copy Markdown
Collaborator

PR-Reviewer-Ant commented May 28, 2026

Review posted through GitHub's PR review UI for commit 15867931.

Copy link
Copy Markdown
Collaborator

@PR-Reviewer-Ant PR-Reviewer-Ant left a comment

Choose a reason for hiding this comment

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

Review metadata
  • Reviewer: pr-reviewer
  • Model: gpt-5.5
  • Commit: 15867931

I did not find a concrete blocker in this diff. The implementation matches the PR description: prompt-submit entity selection is narrowed to person/project entities, generic one-token entities are filtered, possessive matching is preserved, and the Rust shadow path has matching regressions.

Confidence: Medium [sufficient_diff_evidence, missing_runtime_repro] - The selector behavior is directly visible in platform/daemon/src/hooks.ts and mirrored in platform/daemon-rs/crates/signet-daemon/src/routes/hooks.rs, with targeted TS and Rust tests covering possessives, disallowed entity types, generic plural terms, and longest non-overlapping spans. I did not run the stated validation commands or inspect the live ontology data distribution, so residual risk is mainly around real-world scoring thresholds rather than a provable diff bug.

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.

2 participants