Commit Graph
26 Commits
Author SHA1 Message Date
didier 5be2005f70 feat: HMAC-signed cookies for UI sessions, bcrypt hash for admin bootstrap, simplified NixOS module 2026-06-16 13:12:51 -04:00
didier 56da3bae61 feat: deepseek is insanly good 2026-06-16 13:02:13 -04:00
didier be9d6b610f feat: added auth and crazy more things 2026-06-16 12:55:56 -04:00
didier 1ecf468140 feat: added AGENTS.md 2026-06-16 11:16:01 -04:00
didier 4473a6e3d0 feat: improved front-end 2026-06-08 08:54:01 -04:00
didier de6480ba4e feat: started to make things work 2026-06-07 12:30:08 -04:00
didier 9e21732d00 feat: add Mithril frontend for flashcard visualization (nes.css) 2026-06-05 17:13:58 -04:00
didier a40542f7b4 feat: add vote_flashcard MCP tool 2026-06-05 17:04:05 -04:00
didier cd8e872491 feat: add REST API for flashcards (/api/v1/flashcards/*) 2026-06-05 16:53:18 -04:00
didier f30d34d20a chore: update vendorHash in flake.nix for godotenv dep 2026-06-05 16:20:56 -04:00
didier c86e34a01d fix: materialize FTS hits before fetching entries to avoid sqlite deadlock 2026-06-05 16:09:46 -04:00
didier ffdc023065 refactor: SearchEngine interface, remove nilable qdrantStore 2026-06-05 16:02:31 -04:00
didier 98aa7dd68c feat: added fts5 backend 2026-06-05 15:51:41 -04:00
didier d5cae6efa9 Add sqlite write permission check and preStart chown
- newSqliteStore now checks directory writability before opening
- Immediate SELECT 1 ping catches readonly DB early
- Systemd preStart chown ensures db file ownership is correct
- Fixes: SQLITE_READONLY_CANTINIT (1032)
2026-06-04 09:23:59 -04:00
didier 55081bc5aa Remove conflicting migrations, keep schema in 000001
000001 was modified to include public_id, version, delete_timestamp
but 000002/000003 tried to ALTER TABLE to add the same columns,
causing duplicate column errors on existing databases where
migrations had run partially.

Fix: only 000001 with the full schema. No 000002/000003.
2026-06-04 08:44:58 -04:00
didier c364a7798f Use optionalAttrs instead of mkIf in serviceConfig
mkIf doesn't merge correctly with the // operator;
optionalAttrs returns a plain set that works with //.
2026-06-04 08:27:15 -04:00
didier e0fe59d92b Make EnvironmentFile conditional in systemd service
Only include EnvironmentFile when at least one *File option
(openaiApiKeyFile, tokenFile, qdrantApiKeyFile) is set.
Without this, an empty EnvironmentFile list causes systemd
to fail with 'Failed to load environment files'.
2026-06-04 08:22:16 -04:00
didier e700a81c25 Add versioning, update tool, and soft-delete
Schema: public_id + version columns with UNIQUE constraint,
delete_timestamp for soft-delete.

Tools: store_flashcard accepts optional public_id, update_flashcard
creates a new version preserving history, delete_flashcard inserts
a tombstone row and removes the Qdrant point.

Qdrant: point ID is public_id (only latest version indexed).
2026-06-03 20:15:18 -04:00
didier 726ab62c62 Remove content fallback, fix README tool docs
- Drop the content alias from store_knowledge handler
- Fix error message to say 'note' only
- Correct README store_knowledge params to match actual API
- Fix EMBEDDING_BASE_URL default (no /v1 suffix)
2026-06-03 19:35:57 -04:00
didier 338d4cb34e Add /version endpoint with build metadata
- /version returns JSON with build_date and git_commit from env vars
- NixOS module injects GIT_COMMIT (first 8 chars of self.rev)
  and BUILD_DATE (self.lastModified) into systemd service environment
2026-06-03 19:33:52 -04:00
didier 3546e19772 Serve MCP at /mcp, keep /health at root
- Route MCP streamable handler to /mcp via http.ServeMux
- Move /health to a dedicated mux route (no auth required)
- Simplify authMiddleware by removing /health special case
- Apply CORS middleware at the mux level
- Ignore nix build result symlink
2026-06-03 19:29:46 -04:00
didier 44b7306064 fix: update vendorHash for new dependencies 2026-06-02 10:13:50 -04:00
didier 39c6185b70 feat: sqlite persistence with goose migrations, flashcard schema, zap logger
- Add SQLite as authoritative store alongside Qdrant (best-effort indexing)
- Use goose for embedded SQL migrations
- Schema matches flashcard format: id(INTEGER PK), note, repos, host, tags, user, context, created
- Replace std log with zap structured logger
- Split registerTools into registerStoreKnowledge + registerSearchKnowledge
- Qdrant index uses SQLite rowid directly as point ID (no SHA256 hash)
- Search enriches Qdrant results from SQLite by ID
- Lowercase auth header before prefix check
- Always handle json.MarshalIndent errors
- NixOS: StateDirectory, sqlitePath to /var/lib/st-pierre/st-pierre.sqlite
2026-06-02 10:01:28 -04:00
didier 5ac11631d4 fix: embedding URL path missing /v1 prefix
The embedding endpoint path was  but OpenAI-compatible APIs
serve embeddings at . When EMBEDDING_BASE_URL is set to a
bare host (e.g. https://llm.aviron.ai), the resulting URL would be
/eembeddings instead of /v1/embeddings, returning 404.

Changed defaultBaseURL to not include /v1 and always use /v1/embeddings
as the endpoint path.
2026-06-01 13:09:38 -04:00
didier 306fea37fd add inline openaiApiKey and token options 2026-05-31 15:50:41 -04:00
didier 2ffae91aa7 first commit 2026-05-31 12:35:40 -04:00