Compare commits
5 Commits
codex/issu
...
codex/issu
| Author | SHA1 | Date | |
|---|---|---|---|
| f10bff9ba4 | |||
| 14d9276c30 | |||
| 84b2c9ebc9 | |||
| 9263157a9e | |||
| f7b527763d |
@@ -1,6 +1,6 @@
|
||||
# Agent Handoff
|
||||
|
||||
Last updated: 2026-07-03
|
||||
Last updated: 2026-07-04
|
||||
|
||||
## Latest Completed Work
|
||||
|
||||
@@ -12,7 +12,11 @@ Last updated: 2026-07-03
|
||||
- The build workflow now targets `git.wilkensxl.de/code-inc/intelligence-terminal` and publishes only from the production branch, not from pull requests.
|
||||
- Gitea Actions runs 231-235 passed for the PR and production merge, including unit tests, Compose validation, Docker build, release dry-run, and template compliance.
|
||||
- The first `code-inc` registry publication was verified through the Gitea Package API on 2026-07-03.
|
||||
- Related maintenance: issue #21 tracks the failing security scan, #45 tracks the dependency workflow, and #46 tracks remaining namespace/handoff cleanup.
|
||||
- PR #52 / issue #51 removed the hard-coded 90-second/4096-token idea-generation override. LLM ideas now respect `LLM_TIMEOUT_MS` and `LLM_MAX_TOKENS`.
|
||||
- PR #54 / issue #53 fixed prediction persistence after successful LLM generation and added a SQLite-backed regression test.
|
||||
- Live Dockge verification on 2026-07-04 used `LLM_TIMEOUT_MS=300000` and `LLM_MAX_TOKENS=4096` with the `heim-llm` LiteLLM alias. The completed sweep produced six parsed ideas, reported `ideasSource=llm`, persisted memory, and had no `lastSweepError`.
|
||||
- Production implementation commit: `14d9276c30e06cafcaee8177ba7377fdf5f26277`.
|
||||
- Issues #47, #51, and #53 are complete. Issue #21 tracks the failing security scan and #45 tracks the dependency workflow.
|
||||
|
||||
## Repository State
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ export class IntelligenceStore {
|
||||
_recordPredictions(data, timestamp) {
|
||||
for (const idea of data.ideas || []) {
|
||||
const title = idea.title || 'Untitled idea';
|
||||
const stableId = stableId('prediction', title, idea.type || '', idea.ticker || '', idea.horizon || '');
|
||||
const predictionId = stableId('prediction', title, idea.type || '', idea.ticker || '', idea.horizon || '');
|
||||
const evidence = Array.isArray(idea.signals) ? idea.signals : [];
|
||||
this.db.prepare(`INSERT INTO predictions (
|
||||
stable_id, created_at, updated_at, title, type, hypothesis, evidence_json, confidence,
|
||||
@@ -217,7 +217,7 @@ export class IntelligenceStore {
|
||||
confidence=excluded.confidence,
|
||||
evidence_json=excluded.evidence_json,
|
||||
payload_json=excluded.payload_json`).run(
|
||||
stableId,
|
||||
predictionId,
|
||||
timestamp,
|
||||
timestamp,
|
||||
title,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"brief:save": "node apis/save-briefing.mjs",
|
||||
"diag": "node diag.mjs",
|
||||
"test": "npm run test:unit",
|
||||
"test:unit": "node --test test/llm-openrouter.test.mjs test/llm-ollama.test.mjs test/llm-openai-compatible.test.mjs test/llm-litellm.test.mjs test/llm-ideas.test.mjs test/fetch-utils.test.mjs test/reddit-source.test.mjs test/acled-source.test.mjs test/mojibake-text.test.mjs test/adsb.test.mjs test/dashboard-geotagging.test.mjs",
|
||||
"test:unit": "node --test test/llm-openrouter.test.mjs test/llm-ollama.test.mjs test/llm-openai-compatible.test.mjs test/llm-litellm.test.mjs test/llm-ideas.test.mjs test/intelligence-store.test.mjs test/fetch-utils.test.mjs test/reddit-source.test.mjs test/acled-source.test.mjs test/mojibake-text.test.mjs test/adsb.test.mjs test/dashboard-geotagging.test.mjs",
|
||||
"compose:config": "docker compose config",
|
||||
"clean": "node scripts/clean.mjs",
|
||||
"fresh-start": "npm run clean && npm start"
|
||||
|
||||
44
test/intelligence-store.test.mjs
Normal file
44
test/intelligence-store.test.mjs
Normal file
@@ -0,0 +1,44 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { IntelligenceStore } from '../lib/intelligence-store.mjs';
|
||||
|
||||
test('records LLM ideas as stable predictions', async (t) => {
|
||||
const directory = mkdtempSync(join(tmpdir(), 'intelligence-store-'));
|
||||
t.after(() => rmSync(directory, { recursive: true, force: true }));
|
||||
|
||||
const store = await new IntelligenceStore(join(directory, 'intelligence.db')).init();
|
||||
if (!store.available) {
|
||||
t.skip(`node:sqlite unavailable: ${store.reason}`);
|
||||
return;
|
||||
}
|
||||
|
||||
store.recordRun({
|
||||
meta: {
|
||||
timestamp: '2026-07-04T10:17:51.011Z',
|
||||
sourcesOk: 22,
|
||||
sourcesDegraded: 7,
|
||||
sourcesFailed: 0,
|
||||
},
|
||||
ideasSource: 'llm',
|
||||
ideas: [{
|
||||
title: 'Gold safe-haven hedge',
|
||||
type: 'HEDGE',
|
||||
ticker: 'GLD',
|
||||
confidence: 'MEDIUM',
|
||||
rationale: 'Geopolitical risk remains elevated.',
|
||||
risk: 'Risk appetite recovers.',
|
||||
horizon: 'Weeks',
|
||||
signals: ['geopolitical escalation'],
|
||||
source: 'llm',
|
||||
}],
|
||||
}, { summary: { direction: 'risk-off' } });
|
||||
|
||||
const result = store.listPredictions({ limit: 10 });
|
||||
assert.equal(result.available, true);
|
||||
assert.equal(result.predictions.length, 1);
|
||||
assert.equal(result.predictions[0].title, 'Gold safe-haven hedge');
|
||||
assert.match(result.predictions[0].stable_id, /^[a-f0-9]{24}$/);
|
||||
});
|
||||
Reference in New Issue
Block a user