freedom-intelligence/workplans/FI-WP-0002-activity-core-daily-research.md
tegwick b5f911140b Establish Freedom Intelligence lab foundation and baseline research.
Add INTENT/SCOPE, daily-brief playbook, activity-core definition (disabled),
workplans FI-WP-0001..0003, baseline field survey with open-weight collection
recommendations, and inventory catalog candidates for the model reserve.
2026-07-24 00:15:27 +02:00

208 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: FI-WP-0002
type: workplan
title: "Activity-core daily research brief rhythm"
domain: infotech
repo: freedom-intelligence
status: active
owner: grok
topic_slug: freedom-intelligence
priority: high
created: "2026-07-24"
updated: "2026-07-24"
depends_on:
- FI-WP-0001
---
# FI-WP-0002 — Activity-core daily research brief rhythm
## Goal
Schedule and emit the **Freedom Intelligence daily research brief** via
**activity-core**, following the proven Binky rhythm pattern:
```text
Temporal cron (activity-core)
→ context: fi_brief_status (due?)
→ rule emit activity_task_spawn (state-hub sink)
→ consumer (agent-harness / operator) runs playbook in freedom-intelligence
→ progress event fi_daily_brief (idempotence for next day)
```
activity-core answers **when / what / where**. It does **not** write the brief.
Execution stays in this repo (or a harness checking out this repo).
## Architecture
| Piece | Location | Role |
| ----- | -------- | ---- |
| ActivityDefinition | `freedom-intelligence/activity-definitions/fi-daily-research-brief.md` | Cron + rules |
| External def load | activity-core `ACTIVITY_DEFINITION_DIRS` / external paths | Discover domain def |
| Context resolver | activity-core state-hub query `fi_brief_status` (or shell equivalent) | `due` for today |
| Task sink | state-hub `activity_task_spawn` | Default safe sink |
| Consumer | agent-harness Green/Blue or manual operator session | Run playbook |
| Completion | State Hub `fi_daily_brief` progress event | Clears `due` |
Reference contracts:
- `activity-core/docs/task-emission-consumer-contract.md`
- Binky: `activity-definitions/binky-daily-rhythm.md` + `binky-control/OperatingRhythm.md`
- `docs/daily-brief-playbook.md` (this repo)
## Schedule (proposed)
| Field | Value |
| ----- | ----- |
| Cron | `30 7 * * 1-5` (weekdays 07:30) |
| Timezone | `Europe/Berlin` |
| Misfire | `skip` |
| First enable | after dry-run spawn + one manual brief completion event proven |
Weekends optional later (`0 9 * * 6` optional Saturday scan) — not in v1.
## Tasks
### T01 — ActivityDefinition (domain repo, disabled)
```task
id: FI-WP-0002-T01
status: done
priority: high
```
Add `activity-definitions/fi-daily-research-brief.md`:
- `enabled: false` until dry-run passes
- cron + timezone as above
- context source for due check (stub params documented if resolver not yet live)
- rule: emit task when `due`, `target_repo: freedom-intelligence`, labels
`["freedom-intelligence", "research-brief", "automated"]`
- description points at `docs/daily-brief-playbook.md`
**Done when:** file exists, frontmatter valid, matches ADR-002 shape used by
existing definitions (binky / forgejo prune).
---
### T02 — Completion event contract + playbook hook
```task
id: FI-WP-0002-T02
status: done
priority: high
```
Document and implement playbook steps for:
```yaml
event_type: fi_daily_brief
author: <agent-or-operator>
summary: "FI daily brief YYYY-MM-DD"
detail:
repo: freedom-intelligence
date: "YYYY-MM-DD"
path: "briefs/YYYY/MM/YYYY-MM-DD.md"
collection_candidates: <int>
```
Wire into `docs/daily-brief-playbook.md` and `docs/state-hub-delivery.md`.
**Done when:** completion evidence shape is unambiguous for a future resolver.
---
### T03 — `fi_brief_status` context resolver (activity-core)
```task
id: FI-WP-0002-T03
status: todo
priority: high
```
**Cross-repo (activity-core):** implement state-hub (or shell) resolver:
- Query name: `fi_brief_status`
- Returns `{ items: [{ kind: "daily_brief", due: bool, date: "YYYY-MM-DD" }] }`
- `due: true` when no `fi_daily_brief` progress event with
`detail.repo=freedom-intelligence` exists for today (Europe/Berlin)
Mirror `binky_rhythm_status` pattern. Add unit tests with mocked hub.
**Done when:** resolver merged in activity-core and callable from definition params.
---
### T04 — Register external activity-definitions path
```task
id: FI-WP-0002-T04
status: todo
priority: high
```
**Cross-repo / ops:** ensure railiance activity-core worker loads this repos
`activity-definitions/` (env `ACTIVITY_DEFINITION_DIRS` or documented external
path). Run `make sync-activity-definitions` / schedule reconciliation.
**Done when:** definition appears in automation inventory; schedule id
`activity-schedule-fi-daily-research-brief` (or equivalent) is visible when enabled.
---
### T05 — Dry-run spawn, then enable
```task
id: FI-WP-0002-T05
status: todo
priority: medium
```
1. Manual `POST .../activity-definitions/<id>/trigger` with def still disabled
or one-shot test path
2. Confirm `activity_task_spawn` in State Hub (no Forgejo spam)
3. Manually execute playbook once; post `fi_daily_brief`
4. Confirm next resolver `due=false` for that date
5. Set `enabled: true` on definition; commit
**Done when:** one full loop proven; weekday schedule live.
---
### T06 — Consumer routing note (agent-harness)
```task
id: FI-WP-0002-T06
status: todo
priority: medium
```
Document how harness/operator picks up `target_repo: freedom-intelligence`
tasks (checkout path, Green/Blue profile, LLM via llm-connect if used). Prefer
**no** Claude Code install on railiance01 (Binky residual lesson).
**Done when:** `docs/daily-brief-playbook.md` § Automation consumer is enough for
the next agent session.
---
## Acceptance (workplan-level)
- [x] Domain ActivityDefinition drafted (`enabled: false`)
- [x] Completion event contract documented
- [ ] Resolver + external path + dry-run enable (T03T05)
- [ ] Consumer path documented for harness (T06)
## Out of scope
- Writing the LLM brief **inside** activity-core workers
- ISSUE_SINK_TYPE=rest / Forgejo issues for this rhythm
- Weekend or multi-brief-per-day schedules
- Full State Hub domain onboarding for freedom-intelligence
## Residual handoffs
| Residual | Owner repo |
| -------- | ---------- |
| `fi_brief_status` resolver | activity-core |
| ACTIVITY_DEFINITION_DIRS pin | activity-core / railiance ops |
| Harness consumer profile | agent-harness / the-custodian as applicable |