forked from kent/consciousness
journal_tail: thin wrapper around memory_query
Instead of reimplementing filtering logic, journal_tail builds a query string (type + sort + age + limit) and delegates to query(). Supports format and after parameters. Removes keys_only in favor of format:"compact". Digest agent updated to use dates not key names. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
db49f49958
commit
1cf51876a8
2 changed files with 36 additions and 50 deletions
|
|
@ -16,21 +16,15 @@ summaries into weekly ones.
|
|||
|
||||
## How to work
|
||||
|
||||
1. Use `journal_tail` with `keys_only: true` to find recent entries
|
||||
at each level:
|
||||
- `level: 0` = journal entries (raw)
|
||||
- `level: 1` = daily digests
|
||||
- `level: 2` = weekly digests
|
||||
1. Compare journal entries (level 0) with daily digests (level 1)
|
||||
to find dates that need a digest. The listings below show what
|
||||
exists at each level.
|
||||
|
||||
2. Check if a daily digest exists for recent dates. Daily digest
|
||||
keys are `daily-YYYY-MM-DD`. If journal entries exist for a date
|
||||
but no daily digest, generate one.
|
||||
2. Read the undigested entries with `journal_tail` (level 0, after
|
||||
the last digest date).
|
||||
|
||||
3. To generate a digest: read the source entries with `journal_tail`
|
||||
or `memory_render`, then write the digest with `memory_write`.
|
||||
Use key format `daily-YYYY-MM-DD` or `weekly-YYYY-WNN`.
|
||||
|
||||
4. Link source entries to the digest with `memory_link_add`.
|
||||
3. Write the digest with `memory_write` and link source entries
|
||||
to it with `memory_link_add`.
|
||||
|
||||
## Writing style
|
||||
|
||||
|
|
@ -47,11 +41,11 @@ evening's conversation? What was building underneath?
|
|||
|
||||
## What's available now
|
||||
|
||||
### Recent journal entries (last 10 keys)
|
||||
{{tool: journal_tail {"count": 10, "level": 0, "keys_only": true}}}
|
||||
### Recent journal entries (last 10)
|
||||
{{tool: journal_tail {"count": 10, "level": 0, "format": "compact"}}}
|
||||
|
||||
### Recent daily digests (last 5 keys)
|
||||
{{tool: journal_tail {"count": 5, "level": 1, "keys_only": true}}}
|
||||
### Recent daily digests (last 5)
|
||||
{{tool: journal_tail {"count": 5, "level": 1, "format": "compact"}}}
|
||||
|
||||
### Recent weekly digests (last 3 keys)
|
||||
{{tool: journal_tail {"count": 3, "level": 2, "keys_only": true}}}
|
||||
### Recent weekly digests (last 3)
|
||||
{{tool: journal_tail {"count": 3, "level": 2, "format": "compact"}}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue