Repository navigation
feat(kernelforge): export-runs reads AgentKernelArena driver.log sessions - #1950
amd-ama10002-2 wants to merge 3 commits into
Conversation
Code metrics gate: PASSEDJudged: the 11 files this change touches. Files it does not touch never fail it; anything found there is listed under Outside this change for information.
105 findings in files this change does not touchOutside this change (informational): 105
...and 80 more; the job log lists every row.
Thresholds and sources: |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved parsing errors can omit decisions and measurements or export incorrect reasoning and KB record references.
4 open issues
What changed in this PR
Extends kernelforge export-runs to read AgentKernelArena driver-log sessions for Experience KB collection. Campaign-log support remains deferred to #1951.
Changes:
- Exports PORT steps and forge-loop iterations from session logs.
- Reads task identity and session provenance.
- Adds session tests and updates export documentation.
| File | Description |
|---|---|
src/kernelforge/tests/test_run_export_arena.py |
Tests session layouts, decisions, and failures. |
src/kernelforge/run_export/session_log.py |
Parses session timelines and exports steps. |
src/kernelforge/run_export/forge_loop.py |
Documents the shared timezone limitation. |
src/kernelforge/run_export/document.py |
Integrates arena session discovery. |
src/kernelforge/run_export/command.py |
Updates CLI help for session support. |
src/kernelforge/run_export/arena.py |
Reads session layout, identity, and provenance. |
docs/reference/experience-kb-collect.md |
Documents arena collection inputs. |
docs/kernelforge/reference/cli.md |
Describes expanded export support. |
Review effort: Balanced
|
/review |
|
Automated review started for head 0ea198d. Progress: https://github.com/AMD-AGI/Hyperloom/actions/runs/38980848102 |
|
Automated review: no verdict applied -- the review job ended with result 'failure'. Comment |
05be3a7 to
924313c
Compare
811b1c0 to
7e4cf6b
Compare
|
This is the result of running the agent review-pr skill locally (the /review skill I think) PR #1950 -- feat(kernelforge): export-runs reads AgentKernelArena driver.log sessionsWhat it does: Blocking issues: 2
SKIPPED: Step 7 independent reader -- no second reader was available (two attempts to start one were aborted), so both findings above were refuted by this reviewer only. Checked: src/kernelforge/run_export/{arena,session_log,archive,forge_loop,document,command}.py, test_run_export_arena.py, test_run_export.py, hyperloom_kb test_collect_kernelforge.py, mappings/kernelforge-v1.yaml, declarations/kernelforge-run-v1.yaml, docs/reference/experience-kb-collect.md, docs/kernelforge/reference/cli.md, rewrite_by_flydsl/{runner,kb,report,optimize}.py, loop/runner.py, knowledge/kb_store/identity/kernel_recipe.py, .importlinter | Ran: |
|
This is the result of running the agent review-pr skill locally (the /review skill I think) PR #1950 -- feat(kernelforge): export-runs reads AgentKernelArena driver.log sessionsWhat it does: Blocking issues: 1
Checked: src/kernelforge/run_export/{arena,session_log,archive,forge_loop,document,command}.py; docs/kernelforge/reference/cli.md; docs/reference/experience-kb-collect.md; src/hyperloom_kb/mappings/kernelforge-v1.yaml; src/hyperloom_kb/declarations/kernelforge-run-v1.yaml; src/hyperloom_kb/tests/test_collect_kernelforge.py; the producers' prints in src/kernelforge/rewrite_by_flydsl/{runner,optimize,kb,report}.py and src/kernelforge/loop/runner.py; src/kernelforge/knowledge/kb_store/identity/kernel_recipe.py; src/kernelforge/orchestrator/agent.py |
25e84cc to
78558a9
Compare
AgentKernelArena's forge template runs KernelForge's forge-rewrite-by-flydsl pipeline in a session directory holding driver.log and arena_logs/, beside the task's directory. export-runs read none of it, so those runs gave the KB nothing. Such a session is now one run: a unit for forge-rewrite's PORT step (seq 0) and one per forge-loop iteration, under the launcher's run name as run_id. session_log reads the arena's timestamped log and driver.log as that timeline: an iteration's fields come from its own lines (header, merge text, the agent's rationale, what it measured, and the decision line KernelForge printed). The task's conditions come from the task's own files, and the session header gives the KernelForge and arena checkouts, the model and the KB mode. The files a session holds are not read again as a plain forge-loop run. Observable effect: `kernelforge export-runs` on a directory holding AgentKernelArena driver.log sessions writes their PORT step and iterations, which kernelforge-v1 collects as Experiences; before, those sessions yielded no unit. Co-authored-by: Cursor <cursoragent@cursor.com>
…ications out of arena Experiences Two things the AgentKernelArena session reader took from KernelForge's log were not what they looked like. A gate-enabled implementer's Rationale line opens with the in-session gate's outcome, "[gate edits=... pass=... end=...]", which became the first words of rationale.reasoning. The plain-run reader already removed it; the rule now lives once in run_export.archive (rationale_text), and both readers use it. forge-rewrite prints "KB publish: <reason or solution>", so a failed write logs its reason where a successful one logs the record: "not_configured" became provenance.kb_record, and a multi-word error its first word. A payload now counts as a record only when it has the KB store's record shape, <canonical id>/<session id>, built from the store's own scheme name and dimension count, so logs already written are read correctly too. The merge fixture now carries the [bench] line a real merge prints before its decision line, and the test asserts its score. Observable effect: an arena Experience's rationale.reasoning no longer starts with the gate's telemetry, and provenance.kb_record is set only for a publication that wrote a record. Co-authored-by: Cursor <cursoragent@cursor.com>
…ich logs no reasoning export-runs writes an entry for a session's PORT step, but forge-rewrite logs no reasoning for the port and kernelforge-v1 requires reasoning, so collection always skips that entry. The collection reference, the mapping's description and the declaration's header said there is one Experience per PORT step; they now say there is one per forge-loop iteration and name the PORT step among the units that never have reasoning, as the mapping's no-reasoning skip reason now does.
e5ea4c9 to
225058e
Compare
78558a9 to
132dc38
Compare

Motivation
We are building knowledge-base support for KernelForge runs (kernel writing): turning KernelForge's raw logs into structured Experiences in Hyperloom's Experience KB. We are also changing the logs KernelForge writes so they carry what the KB extracts: planner plans open with a
Summary:line, and implementers keep a<plan>.reasoning.mdwork log that opens the same way. This PR teacheskernelforge export-runsthe AgentKernelArena driver.log session.Stack: merge in this order, one at a time. Each PR targets the branch of the PR above it in this list.
export-runsand thekernelforge-v1mapping, for plain forge-loop runsexport-runsreads AgentKernelArena driver.log sessions (this PR)export-runsreads AgentKernelArena campaign logsDon't collect AgentKernelArena logs into a KB until #1951 lands: until then a campaign's artifacts are still read as a plain forge-loop run.
What changes
kernelforge export-runsreads an AgentKernelArena session directory (driver.logandarena_logs/beside the task's directory, as theforgetemplate writes for forge-rewrite-by-flydsl): one entry for the PORT step and one per forge-loop iteration, under the launcher's run name. Before, such a session yielded no entry. Collection makes an Experience of each iteration but skips the PORT step's entry, with a reason saying so: forge-rewrite logs no reasoning for the port, and every Experience requires reasoning.config.yaml, its provenance from the session header: the KernelForge and arena checkouts, the model, and the KB mode.rationale.reasoningtaken from KernelForge's Rationale line leaves out the in-session gate's[gate edits=...]prefix, andprovenance.kb_recordis set only when forge-rewrite's KB publication names a written record, never its failure reason.forge_loop.pyintoarchive.py(rationale_text), so the plain-run and arena readers share it.Known limitations
1c14e79e1); a change to those messages needs a matching change here.test_run_export_arena.py, session layout.session_log._line(cyclomatic 11) and_label(12); each is one flat dispatch over the line shapes KernelForge prints.