Files
kaizen-agentic/docs/integrations/helix-forge-correlation.md
tegwick c004c3d4d7
Some checks failed
ci / test (3.10) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled
feat: WP-0005 adoption polish — doc sync, fleet parity, CI lint
- Add make agents-sync-package and release-check parity gate
- Add tests/test_packaged_agents_parity.py; sync packaged agents with agents/
- Update install docs (HELLO_WORLD, CLI_CHEAT_SHEET, AGENT_DISTRIBUTION)
- Expand PACKAGE_RELEASE.md secrets setup and pre-tag checklist
- Add flake8 to Gitea CI; CHANGELOG Unreleased for v1.2.0
- Expand INTEGRATION_PATTERNS activity-core handoff checklist
2026-06-16 02:26:13 +02:00

109 lines
3.4 KiB
Markdown

# Helix Forge Correlation Contract
Cross-repo contract between **kaizen-agentic** (project metrics, ADR-004) and
**agentic-resources** (Helix Forge fleet session metrics).
## Purpose
Link a project-scoped agent execution record to the fleet session that produced
it, without duplicating session JSONL ingestion in kaizen-agentic.
## Layers
| Layer | Owner | Storage |
|-------|-------|---------|
| Project | kaizen-agentic | `.kaizen/metrics/<agent>/executions.jsonl` |
| Fleet | agentic-resources | Helix Forge digest store (`digests` table) |
## Correlation fields (ADR-004)
Optional on each project execution record:
```json
{
"helix_session_uid": "claude:17092961-…",
"repo": "kaizen-agentic",
"flavor": "claude",
"tokens": 12500,
"infra_overhead_share": 0.12
}
```
### Field mapping
| Helix Forge (`session_memory`) | ADR-004 project record |
|-------------------------------|------------------------|
| `Session.session_uid` | `helix_session_uid` |
| `Session.repo` | `repo` |
| `Session.flavor` | `flavor` |
| `digest.cost.input_tokens + output_tokens` | `tokens` |
| MCP tool share of `tool_histogram` | `infra_overhead_share` |
| `digest.outcome == "success"` | informs `success` at record time |
| `digest.cost.wall_clock_s` | complements `execution_time_s` |
## Population at session close
### Automatic (environment)
When Helix Forge capture is active in the same shell session:
```bash
export HELIX_SESSION_UID="claude:17092961-…"
export HELIX_REPO="kaizen-agentic"
export HELIX_FLAVOR="claude"
export HELIX_TOKENS="12500"
export HELIX_INFRA_OVERHEAD_SHARE="0.12"
kaizen-agentic metrics record tdd-workflow --success --time 4200 --quality 0.9
```
`metrics record` merges env vars into the execution record before append.
### Explicit (JSON)
```bash
echo '{
"success": true,
"execution_time_s": 4200,
"quality_score": 0.9,
"helix_session_uid": "claude:17092961-…",
"repo": "kaizen-agentic",
"flavor": "claude",
"tokens": 12500,
"infra_overhead_share": 0.12
}' | kaizen-agentic metrics record tdd-workflow --json
```
## Fleet lookup (read-only)
```bash
export HELIX_STORE_DB=~/.helix-forge/store.db # agentic-resources session store
kaizen-agentic metrics correlate claude:17092961-…
```
When `HELIX_STORE_DB` is unset, `metrics correlate` returns a **stub** response
documenting expected fields — no ingestion code runs in kaizen-agentic.
## Bidirectional references
| Document | Repo |
|----------|------|
| [ADR-004](../adr/ADR-004-project-metrics-convention.md) | kaizen-agentic |
| [wiki/EcosystemIntegration.md](../../wiki/EcosystemIntegration.md) | kaizen-agentic |
| [DESIGN-session-memory.md](https://github.com/coulomb/agentic-resources/blob/main/docs/DESIGN-session-memory.md) | agentic-resources |
| `session_memory/core/store.py``get_digest()` | agentic-resources |
**Reciprocal link status:** agentic-resources should link back to this document from
its session-memory design notes. As of WP-0005, verify
`agentic-resources/docs/DESIGN-session-memory.md` (or successor) cites this URL:
`https://gitea.coulomb.social/coulomb/kaizen-agentic/src/branch/main/docs/integrations/helix-forge-correlation.md`
Open a cross-repo issue if the link is missing.
## Non-goals
- No Claude/Codex/Grok JSONL ingestion in kaizen-agentic
- No write path to Helix Forge from kaizen-agentic CLI
- No merge of fleet baselines into project `summary.json` (Coach may cite both)