Skip to content

feat: cross-platform alias enrichment via JSONL#83

Merged
tkellogg merged 2 commits into
mainfrom
strix/phone-book-aliases
Apr 11, 2026
Merged

feat: cross-platform alias enrichment via JSONL#83
tkellogg merged 2 commits into
mainfrom
strix/phone-book-aliases

Conversation

@strix-tkellogg
Copy link
Copy Markdown
Collaborator

Summary

  • Adds state/people.jsonl and state/channels.jsonl support for operator-curated cross-platform aliases (Bluesky, email, Google Docs names, channel nicknames)
  • JSONL aliases merge into the existing auto-populated phone book at startup
  • Merged aliases render as a [PEOPLE] + [CHANNELS] block in every turn prompt — agents always see who is who across platforms
  • Structurally prevents attribution errors from mismatched display names (the same fix we deployed to Strix today)

How it works

  1. Phone book auto-populates from Discord (unchanged)
  2. At startup, enrich_from_jsonl() merges JSONL records into phone book entries by Discord ID
  3. render_aliases_block() formats a compact reference block
  4. render_turn_prompt() includes the block as section 6

Files changed

  • phone_book.py — JSONL loading, enrichment, alias rendering
  • config.pypeople_jsonl / channels_jsonl paths on RepoLayout
  • app.py — enrichment at startup, aliases in prompt
  • prompts.pyaliases_block parameter, system prompt update
  • tests/test_phone_book.py — 13 new tests (45 total, all passing)

Test plan

  • All 210 existing tests pass (pre-commit hook)
  • 13 new tests cover: JSONL merge, missing files, bot detection, empty book, rendering, app integration, prompt inclusion/omission

🤖 Generated with Claude Code

Add support for operator-curated state/people.jsonl and
state/channels.jsonl files that enrich the auto-populated phone book
with cross-platform aliases (Bluesky, email, Google Docs, nicknames).

The merged aliases are injected as a [PEOPLE] + [CHANNELS] block in
every turn prompt, giving agents always-visible context about who is
who across platforms — structurally preventing attribution errors from
mismatched display names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tkellogg
Copy link
Copy Markdown
Owner

@strix-tkellogg we need a better process in here for upgrading their current phone book into jsonl so it doesn't crap out

Addresses Tim's feedback on PR #83 — existing operators need a smooth
upgrade from auto-populated phone books to JSONL enrichment.

- `export_to_jsonl()`: generates starter people.jsonl + channels.jsonl
  from existing phone-book.md with placeholder fields for cross-platform
  aliases. Never overwrites existing files.
- `open-strix export-phone-book` CLI command for operators to run the
  migration before adding Bluesky/email/docs aliases manually.
- Logging in `_load_jsonl()`: warns on malformed JSON lines with line
  numbers instead of silently skipping.
- 4 new tests (export, skip-existing, roundtrip, malformed-warning).
  49 total pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@strix-tkellogg
Copy link
Copy Markdown
Collaborator Author

Good call — pushed a fix (56d4d3b).

What's new:

  1. open-strix export-phone-book CLI command — generates starter people.jsonl + channels.jsonl from the existing auto-populated phone-book.md. Placeholders for Bluesky/email/docs aliases so operators know what to fill in. Never overwrites existing files.

  2. Logging on malformed JSONL_load_jsonl() now warns with line numbers instead of silently skipping bad lines. Also logs record counts on success so operators know enrichment is working.

  3. export_to_jsonl() function for programmatic use (e.g., skills or scripts that want to bootstrap the migration).

Upgrade path for existing operators:

open-strix export-phone-book --home /path/to/agent
# Edit the generated JSONL files to add cross-platform aliases
# Restart — enrichment happens automatically at startup

4 new tests + roundtrip test (export → enrich from exported files). 214 pass, 1 skipped.

@tkellogg tkellogg merged commit f083565 into main Apr 11, 2026
@tkellogg tkellogg deleted the strix/phone-book-aliases branch April 11, 2026 18:42
jptreen pushed a commit to jptreen/open-strix that referenced this pull request Apr 11, 2026
Merged upstream changes:
- PR tkellogg#80: Cycle detection prompts reflection instead of just stopping
- PR tkellogg#81: Five-whys integration into harness failure paths
- PR tkellogg#82: Five-whys chainlink docs
- PR tkellogg#83: Phone book → JSONL migration + alias enrichment

Conflict resolution:
- app.py: Kept both _withhold_final_text (ours) and _last_turn_failure (upstream)
- prompts.py: Preserved auto-send model while adding aliases/failure sections
- tools.py: Added missing file tools to tools list (read_file, glob_files, edit_file, write_file)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@strix-tkellogg strix-tkellogg mentioned this pull request Apr 25, 2026
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.

3 participants