Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bunkerlab-net/mempalace
/ functions
Functions
2,248 in github.com/bunkerlab-net/mempalace
⨍
Functions
2,248
◇
Types & classes
117
↓ 2 callers
Function
home_dir
Returns the user's home directory. Checks `HOME` (POSIX), then `USERPROFILE` (Windows), then `HOMEDRIVE`+`HOMEPATH` (legacy Windows). Panics if none
src/config.rs:110
↓ 2 callers
Function
hook_ingest_transcript_sync_wait_for_pid
Poll the transcript pid file until either an in-flight async ingest clears or the time budget expires. Returns `true` when it is safe to spawn the syn
src/cli/hook.rs:730
↓ 2 callers
Function
hook_pid_alive
Check whether a process ID is alive without sending it a signal. On POSIX, `kill -0 <pid>` is the standard existence probe. On non-POSIX platforms th
src/cli/hook.rs:753
↓ 2 callers
Function
hook_precompact
Precompact hook: mine transcript convos and project files, then allow compaction. [`hook_ingest_transcript_sync`] handles the transcript convos synch
src/cli/hook.rs:347
↓ 2 callers
Function
hook_session_start
Session-start hook: create state directory, log the event, and pass through.
src/cli/hook.rs:204
↓ 2 callers
Function
hook_spawn_mine_bg
Spawn `mempalace mine <dir> --mode <mode>` in the background. Appends stdout and stderr to `hook.log`. Writes the child PID to [`PID_FILE_PROJECT`] s
src/cli/hook.rs:803
↓ 2 callers
Function
hook_spawn_mine_sync
Synchronously mine `MEMPAL_DIR` (precompact path — data must land before compaction). Transcript convos are ingested separately via `hook_ingest_tran
src/cli/hook.rs:860
↓ 2 callers
Function
hook_stop_save_blocking
Block-mode stop: return `{"decision":"block"}` asking Claude to save via MCP.
src/cli/hook.rs:318
↓ 2 callers
Function
hook_stop_save_silently
Silent-mode stop: write diary directly, then emit a `systemMessage`.
src/cli/hook.rs:274
↓ 2 callers
Function
hook_write_diary_to_db
Open the palace DB and insert a diary drawer row. Mirrors the SQL in `mcp/tools.rs::tool_diary_write`. Returns the entry ID on success, `None` on any
src/cli/hook.rs:414
↓ 2 callers
Function
is_claude_projects_root
Return `true` if `path` looks like a `.claude/projects/` directory. Heuristic: at least one child directory whose name starts with `-` and which cont
src/palace/session_scanner.rs:34
↓ 2 callers
Function
is_date_only_temporal
Return `true` when `value` is a date-only ISO temporal (`YYYY-MM-DD`).
src/kg/mod.rs:26
↓ 2 callers
Method
is_external_service
Return `true` when this provider's endpoint will send user content off the local machine or private network. URL-based heuristic shared by all three
src/llm/client.rs:94
↓ 2 callers
Function
is_iso_date_bytes
(bytes: &[u8])
src/config.rs:273
↓ 2 callers
Function
is_iso_datetime_bytes
(bytes: &[u8])
src/config.rs:283
↓ 2 callers
Function
is_skip_file
Return `true` if a filename should be excluded from mining.
src/palace/miner.rs:91
↓ 2 callers
Function
is_stop_word
(word: &str)
src/palace/drawer.rs:62
↓ 2 callers
Method
learn_from_text
Scan `text` for new entity candidates and add high-confidence people to the registry. Uses [`detect_entities`] via a temporary file. Returns the name
src/palace/entity_registry.rs:545
↓ 2 callers
Function
looks_like_real_name
Return `true` if `name` looks like a real person's name: has a space and at least two title-cased parts. Rejects single-token handles (`johndoe`), al
src/palace/project_scanner.rs:465
↓ 2 callers
Function
make_heuristic_result
()
src/cli/init.rs:1991
↓ 2 callers
Function
manifest_priority
Numeric sort priority for a manifest filename: lower = higher priority. `pyproject.toml` (0) beats `package.json` (1) beats `Cargo.toml` (2) beats `g
src/palace/project_scanner.rs:346
↓ 2 callers
Function
maybe_migrate_patch_config
Update `palace_path` in config.json if it still points to the legacy DB location.
src/config.rs:602
↓ 2 callers
Function
mine_convos_write_chunks
Write all chunks for one conversation file into the palace.
src/palace/convo_miner.rs:513
↓ 2 callers
Function
name_matches
Return `true` when `a` and `b` match as equal strings or as separator-bounded tokens of each other. Mirrors Python's `_name_matches` in `mempalace/mi
src/palace/room_detect.rs:230
↓ 2 callers
Method
on_error
(&mut self, _source_file: &str, _message: &str)
src/sources/context.rs:31
↓ 2 callers
Method
on_item_done
(&mut self, _source_file: &str, _drawers_added: usize)
src/sources/context.rs:30
↓ 2 callers
Function
onboarding_ask_people
Collect people from stdin, looping until the user enters an empty line. For "combo" mode the context (personal vs work) is asked per person. Returns
src/cli/onboarding.rs:185
↓ 2 callers
Function
onboarding_generate_aaak_bootstrap
Write the AAAK entities markdown and critical facts bootstrap files. Both files are written to the mempalace config directory.
src/cli/onboarding.rs:639
↓ 2 callers
Function
onboarding_maybe_scan
Optionally scan `directory` for additional entity candidates and prompt the user. Skips if the user declines the scan prompt. Returns the augmented p
src/cli/onboarding.rs:341
↓ 2 callers
Function
onboarding_seed_entity_registry
Seed the structured `EntityRegistry` (`entity_registry.json`) from onboarding data. Converts `PersonEntry` slices into [`RegistrySeedPerson`] records
src/cli/onboarding.rs:532
↓ 2 callers
Function
parse_cargo_toml
Parse a `Cargo.toml` and return the `package.name` field, or `None` on error.
src/palace/project_scanner.rs:304
↓ 2 callers
Function
parse_package_json
Parse a `package.json` and return the `"name"` field, or `None` on error.
src/palace/project_scanner.rs:264
↓ 2 callers
Function
passthrough
(clean_query: String, len: usize)
src/palace/query_sanitizer.rs:100
↓ 2 callers
Function
purge_file_closets
(connection: &Connection, source_file: &str)
src/palace/closets.rs:83
↓ 2 callers
Function
query_entity_sql
Build the SQL and params for one direction of a `query_entity` call. When `as_of` is provided, the `valid_from`/`valid_to` comparison uses the tempor
src/kg/query.rs:92
↓ 2 callers
Method
recall
Return the full wake-up context (L0 identity + L1 essential story). Equivalent to `layers::wake_up`. Pass `wing` to scope L1 to a single wing.
src/palace/stack.rs:28
↓ 2 callers
Function
reject_symlink
Refuse to write into `path` when it is itself a symbolic link. Defense-in-depth: a pre-placed symlink at an export target would redirect writes to wh
src/palace/exporter.rs:29
↓ 2 callers
Function
resolve_project_name
Resolve the project name for a slug directory by reading session JSONL files. Tries up to `MAX_SESSIONS_TO_TRY` session files (newest first). Falls b
src/palace/session_scanner.rs:220
↓ 2 callers
Function
run
Run the `closet-llm` command. Requires a configured LLM provider (via `llm_opts`). In `dry_run` mode, drawers are listed but the LLM is not called an
src/cli/closet_llm.rs:28
↓ 2 callers
Function
run
Print palace statistics: total drawers, per-wing and per-room counts, KG summary, and entity registry summary.
src/cli/status.rs:9
↓ 2 callers
Function
run
Run the diary-ingest command, filing new diary sections as drawers.
src/cli/diary_ingest.rs:11
↓ 2 callers
Function
run
Print the instruction Markdown for `name` to stdout. Returns `Err` when `name` is not one of the available instruction names.
src/cli/instructions.rs:17
↓ 2 callers
Function
run
Backup the palace database, scan for inconsistencies, and rebuild the inverted word index. `confirm_truncation_ok` bypasses the truncation safety che
src/cli/repair.rs:15
↓ 2 callers
Function
run
( connection: &Connection, query: &str, wing: Option<&str>, room: Option<&str>, n_results:
src/cli/search.rs:6
↓ 2 callers
Function
run
Run the MCP server: read JSON-RPC 2.0 requests from stdin, write responses to stdout.
src/mcp/mod.rs:40
↓ 2 callers
Function
run_create_backup
Checkpoint the WAL and copy the palace database (plus sidecar files) to `.db.bak`.
src/cli/repair.rs:76
↓ 2 callers
Function
run_learn_from_file
Scan swept file content for new entity candidates and update the local registry. Called by [`run`] after a file sweep that added at least one drawer.
src/cli/sweep.rs:76
↓ 2 callers
Function
run_mine
( palace_override: Option<&std::path::Path>, directory: std::path::PathBuf, mode: String, extr
src/app.rs:517
↓ 2 callers
Function
run_process_file
Resolve the output directory for one file and delegate to `split_file`. When `output_dir` is `None`, falls back to the file's parent directory and va
src/cli/split.rs:428
↓ 2 callers
Function
run_prompt_mine
Print the mine prompt and return whether to proceed. With `auto_mine=true` returns `true` immediately without reading stdin. On EOF (non-interactive
src/cli/init.rs:558
↓ 2 callers
Function
run_prompt_proceed
Print the interactive proceed prompt and return whether the user accepted. In `--yes` / CI mode, always returns `true` without prompting. Called by [
src/cli/init.rs:510
↓ 2 callers
Function
run_refine_entities
Optionally refine `detected` using an LLM. Returns `detected` unchanged when LLM is disabled or unavailable. On LLM failure, batch errors are logged
src/cli/init.rs:373
↓ 2 callers
Function
run_scan
Scan for index inconsistencies and report them. Reports two classes of problem: - Drawers with no `drawer_words` entries (content was never indexed).
src/cli/repair.rs:33
↓ 2 callers
Function
safe_open_for_write_truncate
Open a file for writing, refusing to follow a symlink at the target path. On POSIX, `O_NOFOLLOW` makes the open itself fail with `ELOOP` when the fin
src/palace/exporter.rs:47
↓ 2 callers
Function
safe_write
`std::fs::write`-style wrapper that refuses to follow a symlink at `path`.
src/palace/exporter.rs:83
↓ 2 callers
Function
sanitize_iso_date
(value: Option<&str>, field_name: &str)
src/config.rs:262
↓ 2 callers
Method
search
Return L3 keyword search results.
src/palace/stack.rs:60
↓ 2 callers
Function
search_closet_boost_score
Score each row by how many query words appear in its content. Helper for [`search_closet_boost`]. Returns `(source_file, hit_count)` for rows that co
src/palace/closets.rs:195
↓ 2 callers
Function
search_memories_avgdl
(candidates: &[Candidate], doc_lengths: &HashMap<String, i64>)
src/palace/search.rs:377
↓ 2 callers
Function
search_memories_compute_bm25
Re-rank candidates by BM25 score and return the top `n_results`.
src/palace/search.rs:310
↓ 2 callers
Method
source_summary
Describe a source without extracting its content.
src/sources/adapter.rs:196
↓ 2 callers
Function
split_file_extract_timestamps
Extract start and end timestamps from a session's lines. Returns `Some((start_ts, end_ts))` where both are the same timestamp string when only one ti
src/cli/split.rs:205
↓ 2 callers
Function
split_file_write_session
Write one session chunk to disk and print a confirmation line. Returns the path of the written file. `session_idx` is 1-based for display.
src/cli/split.rs:254
↓ 2 callers
Function
sql_temporal_end_expr
`SQLite` expression for comparing a `valid_to`-style column with mixed temporal shapes. Widens date-only stored values to end-of-day (`T23:59:59Z`) s
src/kg/mod.rs:75
↓ 2 callers
Function
sql_temporal_start_expr
`SQLite` expression for comparing a `valid_from`-style column with mixed temporal shapes. Widens date-only stored values (`length = 10`, `-` at posit
src/kg/mod.rs:61
↓ 2 callers
Function
temporal_end_key
Return the comparable instant for a `valid_to`-style temporal value. Date-only inputs are widened to end-of-day so legacy date-only `valid_to` values
src/kg/mod.rs:48
↓ 2 callers
Function
test_db_with_drawer
Insert one test drawer and index its words in an in-memory palace.
src/cli/wakeup.rs:82
↓ 2 callers
Method
to_json_value
Serialize to a `serde_json::Value` for audit-trail persistence.
src/palace/corpus_origin.rs:163
↓ 2 callers
Function
tokens
Split `value` into lowercased tokens bounded by `-`, `_`, `.` or `/`. Token boundaries prevent the "views" / "interviews" substring collision that a
src/palace/room_detect.rs:211
↓ 2 callers
Function
topic_room
Return the synthetic room identifier for a topic tunnel. The `topic:` prefix avoids collisions with literal folder-derived rooms of the same name and
src/palace/graph.rs:778
↓ 2 callers
Function
traverse
BFS traversal from a starting room. Find connected rooms through shared wings. Returns `(results, truncated)` where `truncated` is `true` when the fu
src/palace/graph.rs:152
↓ 2 callers
Function
walk_dir_gitignore
(project_dir: &Path)
src/palace/miner.rs:117
↓ 2 callers
Function
write_valid_jsonl
Write a minimal valid Claude Code JSONL record to `path`. Uses the Claude Code native format: top-level `type` is `"user"` or `"assistant"`, with the
src/cli/sweep.rs:109
↓ 1 callers
Function
add_drawer_index_words
Index a drawer's words inside the `add_drawer` savepoint, releasing or rolling back the savepoint depending on whether indexing succeeds. Called by `a
src/palace/drawer.rs:528
↓ 1 callers
Function
add_drawer_insert
Execute the INSERT OR IGNORE for a drawer inside the `add_drawer` savepoint. On SQL error, rolls back and releases the savepoint before returning `Err
src/palace/drawer.rs:476
↓ 1 callers
Function
add_to_known_entities_merge_category
Merge `names` into `category` inside `existing`. Dispatches to list-merge, dict-merge, or new-category helpers based on the current shape of the cate
src/palace/known_entities.rs:199
↓ 1 callers
Function
add_to_known_entities_merge_dict
Add names to an existing dict-format category as keys with `null` values. The dict shape (`{"Alice": "CODE"}`) is the dialect-registry format. New na
src/palace/known_entities.rs:259
↓ 1 callers
Function
add_to_known_entities_merge_list
Append names to an existing list-format category, deduplicating case-insensitively. Original order of pre-existing entries is preserved; new names ar
src/palace/known_entities.rs:226
↓ 1 callers
Function
add_to_known_entities_new_list
Build a fresh deduplicated list from `names` for a new category. Input order is preserved; case-insensitive duplicates are dropped after the first oc
src/palace/known_entities.rs:287
↓ 1 callers
Function
add_to_known_entities_set_wing_topics
Replace `existing["topics_by_wing"][wing_key]` with a fresh deduplicated list from `topics`, preserving first-seen casing for each topic name. Called
src/palace/known_entities.rs:323
↓ 1 callers
Function
add_triple_check_duplicate
Check whether an active triple already exists and return its ID if so. Called by `add_triple` to keep that function within the 70-line limit.
src/kg/mod.rs:719
↓ 1 callers
Function
add_triple_ensure_entities
Upsert subject and object entities into the graph (INSERT OR IGNORE). Called by `add_triple` to keep that function within the 70-line limit.
src/kg/mod.rs:692
↓ 1 callers
Function
add_triple_insert_row
Execute the final `INSERT INTO triples` for `add_triple`. Extracted to keep `add_triple` within the 70-line limit.
src/kg/mod.rs:819
↓ 1 callers
Function
check_text_kg_contradictions
Called by `check_text` to parse relationship claims from `text` and compare them to the KG. For each "(subject, predicate, object)" claim, queries ou
src/palace/fact_checker.rs:235
↓ 1 callers
Method
classify
( &self, _system: &str, _user: &str, _json_mode: bool,
src/llm/refine.rs:927
↓ 1 callers
Method
classify
( &self, _system: &str, _user: &str, _json_mode: bool,
src/palace/corpus_origin.rs:784
↓ 1 callers
Method
classify
( &self, _system: &str, _user: &str, _json_mode: bool,
src/palace/closet_llm.rs:370
↓ 1 callers
Function
collect_corpus_text_process_entries
Process one directory's `ReadDir` entries for corpus collection. Queues subdirectories onto `stack` and appends prose file content to `text`. Called
src/llm/refine.rs:553
↓ 1 callers
Function
collect_corpus_text_read_file
Read a prose file and append its content to `text` if it fits within the byte cap. Skips files without a recognized prose extension and files that wo
src/llm/refine.rs:587
↓ 1 callers
Function
collect_manifest_names_parse_dir
Parse a single directory's manifest files and append results to `found`. Called by [`collect_manifest_names`] to keep that function within the 70-lin
src/palace/project_scanner.rs:547
↓ 1 callers
Function
compute_topic_tunnels_build_wing_map
Create tunnels for every pair of wings that share `>= min_count` topics. Topics are compared case-insensitively; the first-observed casing (from whic
src/palace/graph.rs:798
↓ 1 callers
Function
confirm_entities_auto
Accept all entities above `CONFIDENCE_THRESHOLD` without prompting. Called by [`confirm_entities`] when `yes=true`.
src/palace/entity_confirm.rs:75
↓ 1 callers
Function
confirm_entities_interactive
Prompt the user interactively for each detected entity above threshold. Called by [`confirm_entities`] when `yes=false`. Returns early without printi
src/palace/entity_confirm.rs:97
↓ 1 callers
Function
create_tunnel_read_back
Read the tunnel row back after upsert — the pair assertion half of the write.
src/palace/graph.rs:583
↓ 1 callers
Function
create_tunnel_upsert
UPDATE the tunnel if it exists, INSERT if it does not. The UPDATE-then-INSERT pattern (rather than INSERT OR REPLACE) preserves `created_at` on repea
src/palace/graph.rs:529
↓ 1 callers
Function
current_locale_quote_re
Compile the current locale's `quote_pattern` regex on demand. Returns `None` when the locale JSON omits `quote_pattern` or the pattern fails to compi
src/dialect/mod.rs:38
↓ 1 callers
Function
decode_fill_content
Called by [`Dialect::decode`] to populate content fields of `decoded`. Parses a content line of the form `0:ENTITIES|topics|"quote"|emotions|FLAGS`.
src/dialect/mod.rs:584
↓ 1 callers
Function
decode_fill_header
Called by [`Dialect::decode`] to populate header fields of `decoded`. Expects a pipe-separated string of the form `WING|ROOM|DATE|STEM`. Missing segm
src/dialect/mod.rs:464
↓ 1 callers
Function
dedup_delete_drawer
Delete one drawer and every row that references it. Without this, dropping a drawer would leave dangling `triples.source_drawer_id` and `explicit_tun
src/palace/dedup.rs:286
↓ 1 callers
Function
dedup_delete_drawer_inner
Run the five reference-cleanup statements that compose `dedup_delete_drawer`. Split out so the transaction wrapper can call a single fallible body an
src/palace/dedup.rs:302
← previous
next →
401–500 of 2,248, ranked by callers