pg-compact-generates-budget-constrained-markdown
IN premise
`PgApi.compact()` produces a markdown summary of the belief network constrained by a token budget, filtered by `visible_to` access tags, sorted by dependent count, with summary-node elision and nogood inclusion
Summary
The compaction process creates a condensed markdown snapshot of the belief network that fits within a token limit. It prioritizes beliefs with the most dependents, respects access controls so each viewer only sees what they should, hides individual summary nodes to reduce clutter, and includes any recorded contradictions. This means the system can hand off a compact but representative view of its knowledge state to an LLM context window without blowing the budget or leaking restricted information.
Details
| Source | entries/2026/04/29/tests-test_pg.md |