Commit graph

126 commits

Author SHA1 Message Date
254e3da1d8 chore(release): MIT license + CONTRIBUTING/SECURITY/CODE_OF_CONDUCT + README badges (S12) 2026-07-05 08:10:09 +02:00
bdba6f66c6 docs(i7): reproduserbar grep i statusrapport rad #10/#11 (--exclude selv-referanse) 2026-07-04 23:34:26 +02:00
c1af510fba docs(i7): program status report — bevist/ikke-bevist + verifiseringslogg (I7) 2026-07-04 22:54:06 +02:00
329bcda67d docs(i7): sharpen D7 boundary in extending.md — CSV+SQL built, HTTP/MCP MAF-only 2026-07-04 22:48:01 +02:00
d8ee8d3e46 docs(i7): refresh stale README ingest status — implemented (CSV+SQL both stacks, HTTP MAF-only demo) 2026-07-04 22:44:58 +02:00
3957354408 docs(i7): trekbrief + trekplan for program-avslutning — execute parked (fresh session)
Brief (framing=preserve, 0 research, validator PASS, brief-reviewer PROCEED) +
plan (3 steg, v1.7 strict PASS). plan-critic fanget 1 BLOCKER (README real-source
overclaim) → adressert; scope-guardian ALIGNED. Execute parkert til fersk økt på
20% kontekst. README/extending URØRT denne økta.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJET4jzpqykqEaQKQDqbS6
2026-07-04 20:41:02 +02:00
72cb15feed docs(i6): trekreview WARN — 1 MAJOR (scope, moot), code-correctness clean
Forrige økt kjørte /trekreview men lukket ikke loopen (review.md untracked,
STATE ikke oppdatert). Denne committen tar review-artefaktet inn i den tracked
brief→plan→review-serien.

Verdict WARN: 0 BLOCKER, 1 MAJOR, 0 MINOR. Code-correctness clean (0 defekter,
7 dim); alle 9 Success Criteria tracer, alle 7 Non-Goals holdt. MAJOR =
SCOPE_CREEP_BUILT om fe4ae69 (parallell operatør-commit Fable5→Opus4.8 på
plandok, i range 2208cdf..696f19a) — akseptert som moot: rørte ingen I6-fil,
recommended_action (split-commit) umulig fordi allerede pushet. Ingen rework.
NESTE: I7 program-avslutning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJET4jzpqykqEaQKQDqbS6
2026-07-04 18:46:49 +02:00
696f19af1e docs(i6): http source extension-point + D7 create_sdk_mcp_server pointer 2026-07-04 17:17:12 +02:00
fe4ae69a1e docs(plan): ingest-rammer — Opus 4.8 xhigh alle økter, ingen Fable 5
Operatørkorreksjon 2026-07-04: §Rammer sa «Fable 5 med xhigh — global default»
(scoped bort fra 2026-07-02-planens Opus-direktiv). Reverseres: Opus 4.8 xhigh
for ALLE økter og alle subagenter, ingen Fable 5 — matcher den globale regelen
(~/.claude/CLAUDE.md, «Modellvalg for subagenter»). Kun plandokumentet endret;
I6-arbeidets untracked-filer urørt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MM6BWb1hWmJZuXFZ7rjxT
2026-07-04 17:17:09 +02:00
24e73f47f6 test(ingest): http golden extraction, byte-deterministic (I6) 2026-07-04 17:12:34 +02:00
bbdcd62ae6 feat(ingest): gate http behind allow_network run-flag + dispatch (I6) 2026-07-04 17:04:05 +02:00
58dda468dc feat(ingest): http read_http connector + injectable transport seam (I6) 2026-07-04 16:57:29 +02:00
2208cdf3e9 docs(i6): plan for http source extension point (I6)
/trekplan for the http source family (MAF-only). Validator green (4 steps,
plan_version 1.7). 5 exploration agents; scope-guardian ALIGNED; plan-critic
REVISE -> all resolved (1 blocker: gate false-green, now asserts both branches
so it goes RED on either detach; 5 major inc. materialize-only flag scoping
verified vs run.py, fence-collision -> fail-fast, create_sdk_mcp_server verified
vs official Agent SDK docs, live-grep scoped to I6 artifacts, golden oracle
hand-derived in-plan). High-effort gemini-bridge pass: re-confirmed BROKEN
(retrieval bug + deprecated model) -> substituted plan-critic + primary-source
checks (CommonMark 4.5 fence, CPython str.splitlines -> \n-only max_rows count).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015U5UK6gVFJNvTEdDcyUb8W
2026-07-04 09:40:36 +02:00
bc52c12ddb docs(i6): brief for http source extension point (I6)
/trekbrief for the http source family (MAF-only). framing=refine,
brief-reviewer 5/5 PROCEED, validator PASS, 0 research topics.
Contract: activate http behind a run-argument opt-in network flag,
local-mock-only (no live source), body verbatim in fenced code block
(§5), golden examples/ingest-golden-http/. Two deferred [ASSUMPTION]s
for /trekplan to pin: max_rows unit + injectable-GET mock seam.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015U5UK6gVFJNvTEdDcyUb8W
2026-07-04 08:50:16 +02:00
1b7612b22d docs(i4): brief + plan + golden fixture builder (I4)
Session brief (scope, non-goals, pinned SQL type/number decisions, verification) + TDD plan + build_fixture.py (regenerates the sqlite golden; the committed db bytes need not reproduce — the golden compares the derived bundle).
2026-07-04 06:56:08 +02:00
4f45fe6037 test(ingest): SQL connector + load-bearing + golden, detach-proven (I4)
New: test_ingest_sql.py (connector mechanics + typed rendering + dispatch), test_ingest_sql_loadbearing.py (SQL seams: typed-NULL, typed-REAL, navigability via unchanged okf), test_ingest_golden_sql.py + examples/ingest-golden-sql/ (byte-frozen sqlite golden; NULL->empty, 4200.0->4200.0 and escape discriminate a typed impl from naive ones). Updated: sql-source refusal test repointed to http (I6); manifest schema-breadth comment. Each new seam proven RED at its detach point.

Refs: shared/ingest-spec.md 11 golden + load-bearing table
2026-07-04 06:56:02 +02:00
d7e5f2fec7 feat(ingest): sqlite sql-source connector + typed cell rendering + dispatch (I4)
read_sql resolves connection_ref from the environment to a sqlite path, opens it read-only (mode=ro so a write in the query fails at the DB), and converts cells to their spec-5 text form: INTEGER plain decimal, REAL shortest round-trip (repr), TEXT verbatim, SQL NULL empty string, BLOB/other IngestError (never silent coercion). materialize now dispatches file->read_csv, sql->read_sql; http stays I6-refused. Pure stdlib (sqlite3/os/contextlib) — MAF-free context-seam guard intact. No spec change (frozen); the SQL type/number rules were delegated to I4.

Refs: shared/ingest-spec.md 4/5/8 · sesjonsplan I4
2026-07-04 06:55:54 +02:00
fdcbaffc88 docs(i2): brief + plan for ingest file/CSV session (I2) 2026-07-03 18:44:37 +02:00
994f5be11c test(ingest): golden extraction case examples/ingest-golden-file, byte-frozen (I2) 2026-07-03 18:40:53 +02:00
e66a2b4015 style(ingest): ruff format (I2) 2026-07-03 18:40:40 +02:00
dbf5dc5c13 test(spec-guard): ingest contract field cross-check vs spec §12 (I2) 2026-07-03 18:38:35 +02:00
6236f2fb78 test(ingest): load-bearing seam quartet + MAF-free guard, detach-proven (I2) 2026-07-03 18:37:30 +02:00
676c11a498 feat(ingest): index generation and stamped-replacement semantics (I2) 2026-07-03 18:33:56 +02:00
bfb3f9afb8 feat(ingest): deterministic materialization with §5/§7 provenance stamp (I2) 2026-07-03 18:31:50 +02:00
f331cb4763 feat(ingest): CSV connector with boundary check, row cap and escaped table body (I2) 2026-07-03 18:29:53 +02:00
e4ee8bd52e feat(ingest): fail-fast manifest contract with verdict reservation (I2) 2026-07-03 18:28:07 +02:00
c33795db3f docs(readme): refocus on LLM-wiki foundation, AI-first framing, and use cases
Rewritten around what the project is built on — Karpathy's LLM-wiki idea
as formalized by Google Cloud's Open Knowledge Format (spec-linked) — how
the 8-step loop works and is set up (shared commons core, per-project
bundles, specified ingest layer), and what the architecture enables.
Adds the AI-first framing: the wiki is written for the model, human
affordances (verdict inbox, promotion gate) are layers on top — the
inverse of a human-first wiki. Honest status kept: offline proof only,
ingest specified but not implemented.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 14:45:05 +02:00
7ba0fae933 test(spec-guard): extend framework guard + structure test to ingest-spec.md (I1)
The neutrality guard now covers BOTH shared specs explicitly (a new spec
file is never guarded implicitly), and a new structure test pins the
ingest spec's normative skeleton incl. the verdict-layer reservation and
the explicit-timestamp field. Proven RED against a throwaway copy with a
framework name injected and with a required section dropped; field-level
cross-check vs contract code arrives with the I2 contracts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 14:05:39 +02:00
4df2140694 chore(shared): subtree pull commons — ingest-spec.md (I1) 2026-07-03 14:04:11 +02:00
ef1a2c57e0 Squashed 'shared/' changes from db86e15..7aa53fc
7aa53fc docs(spec): ingest-spec.md — normative ingest layer contract (I1)

git-subtree-dir: shared
git-subtree-split: 7aa53fcf6823bda8c492b53762e3fbfd39ea3058
2026-07-03 14:04:11 +02:00
a3965fb372 docs(plan): målbilde + gated sesjonsplan for ingest-programmet
Program-planleggingssesjon per brief 2026-07-03: alle brief-premisser
verifisert mot ground truth (retrieval-forbudet sitert ordrett), planen
adversarial-reviewet x2 (2 blockere + 8 majors innarbeidet: verdict-lag-
reservasjon, lag-separasjon ved re-ingest, deterministisk timestamp,
guard-dekning, D7/HTTP-ærlighet, gatede spec-endringer). I1 er GATET på
operatør-godkjenning av målbildet. Kun dokumenter — ingen kode-, shared-
eller søskenrepo-endring; suite 157/4 grønn.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 13:45:14 +02:00
234e84c8a9 docs(rapport): S11 — sammenligningsrapport begge stacker på pinned db86e15 2026-07-03 12:50:01 +02:00
695c7590b5 docs(s11): brief + plan for S11 sammenligningen — trippel-reviewet, klar for exec
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 12:28:06 +02:00
aec95eb0da docs(plan): program-brief for ingest-lag — tools/konnektorer mot reelle datakilder
Brief (ikke plan) for nytt program etter S11: ingest-steg som materialiserer
kildeuttrekk til OKF-bundles (metode-spec forbyr query-time retrieval i løkka),
delt manifest-kontrakt i commons, referanseimplementasjon per stack.
Inkluderer oppstartsprompt for planleggingssesjonen.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QdSfQdND84oeq2mbjueLTS
2026-07-03 11:24:24 +02:00
e4cbcae0c0 docs(claude-md): S4 — record commons subtree relation + pull-only sync rule
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 05:44:29 +02:00
7916e10c52 Squashed 'shared/' changes from 7d2b46c..db86e15
db86e15 docs: document subtree consumption — R1 realized, sync is pull-only

git-subtree-dir: shared
git-subtree-split: db86e159148d7d8553a38516e174370cf913f889
2026-07-03 05:43:13 +02:00
dde465d3aa chore(shared): S4 — subtree pull from commons (re-anchor to clean db86e15)
Demonstrates the pull-only sync direction; content already identical,
so this merge only re-anchors the squash metadata to the rewritten
commons main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 05:43:13 +02:00
80c1df5ae7 docs(shared): S4 — sync policy is pull-only (subtree push leaks consumer history)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 05:42:25 +02:00
23a0a59e13 docs(shared): S4 — document subtree sync commands; R1 realized
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 05:37:16 +02:00
e8dd89feb4 Squashed 'shared/' content from commit 7d2b46c
git-subtree-dir: shared
git-subtree-split: 7d2b46cee29d5c4946cef06d067332f705641999
2026-07-03 05:36:01 +02:00
ecd83066fb feat(shared): S4 — re-introduce shared/ as subtree of portfolio-optimiser-commons
commons (ktg/portfolio-optimiser-commons @ 7d2b46c) is now the source of
truth for the framework-neutral shared core; this repo consumes it via
git subtree (--squash) at the unchanged shared/ path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 05:36:01 +02:00
8e2daaee62 chore(shared): S4 — remove in-repo shared/ ahead of subtree re-add from commons
The directory returns in the next commit as a git subtree of
portfolio-optimiser-commons (source of truth), same path, so tests
and the PORTFOLIO_SHARED_ROOT default resolver are unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 05:35:59 +02:00
b7f78ecf7d docs(plan): S3 — comparison protocol (pinned ref, metrics, liveness asymmetry)
Defines the S11 yardstick BEFORE either stack exists: pinned commons-ref
as identical input, metrics M1-M4, the verbatim liveness-asymmetry
declaration, five binding LLM non-determinism rules for S10/S11, and a
ban on comparing offline numbers with live numbers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 01:10:05 +02:00
cebba7d954 feat(shared-root): S3 — configurable shared-root resolver with load-bearing override test
One call-time resolver (env PORTFOLIO_SHARED_ROOT, default the in-repo
shared/) consumed by both MAF-side readers of the shared core:
persona._example_path() (the _EXAMPLE_PATH monkeypatch seam is kept) and
simulation._default_bundle_dir() (replaces the _BUNDLE_DIR module global).
De-risks the S4 extraction: re-pointing the commons becomes an env var,
not a code change. Override test proves the marker follows a tmp copy of
the whole shared tree; both detach points proven RED. Suite 155->157.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 01:10:05 +02:00
5de1c93b69 feat(spec): S2 — normative framework-neutral method spec as the fourth shared artifact
Author shared/method-spec.md: the 8-step loop (normative, RFC-2119), the
verdict JSON contract incl. the id-minting algorithm and the chosen conflict
semantics, the inbox/outbox folder contract, the fail-closed promotion-gate
semantics, the IR projection + golden suite as the only ground truth (incl.
the reproducible Monte Carlo procedure), and the budget/stop, provenance and
startup-contract requirements — every normative claim cross-checked against
the load-bearing tests/code. The sibling implementation builds from this spec
alone.

Load-bearing trio (tests/test_method_spec_loadbearing.py, persona-trio
style): required structure, a name-shaped framework-neutrality guard over the
spec + the persona skill tree, and a cross-check-completeness test driven
from the REAL artifacts and the REAL verdict serializer (red on code drift).
All three detach points proven RED (missing file / framework name / dropped
field). shared/README.md: the "(planned)" line replaced with the real entry.

Suite 152 -> 155 passed / 4 skipped; ruff check+format clean; mypy src clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 00:50:42 +02:00
ae01127510 docs(truth): S1 truth maintenance — CHANGELOG, stack line, MCP claim, conflict semantics, 90% cut-list
Findings 4-7 from the 2026-07-02 status analysis, per the session plan (S1):
- CHANGELOG rewritten truthfully (was: 'Plan phase - no framework code yet')
- README stack line names the split GA packages, not the agent-framework meta-package
- CLAUDE.md: MCP downgraded to extension point (in-process FunctionTool is the default seam)
- Verdict conflict semantics documented as chosen (store first-write-wins per id,
  disk/wiki last-write-wins per file; full B10 taxonomy deliberately deferred)
- docs/extending.md: explicit 90%-principle cut-list (B10, B11, U12, U14, concurrent fan-out)
- .gitignore covers .trekexecute-progress-* (docs/.DS_Store was already untracked/ignored -
  the plan's git rm --cached assumption was stale; no-op)

No code behavior changed (docstring only in verdicts.py). Suite 152/4 green, mypy clean,
ruff format --check clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 00:34:56 +02:00
705c5dd49a chore(format): ruff format the 4 drifted files (no behavior change)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQCFnfsh3tfq1VfzdJpoi
2026-07-03 00:32:49 +02:00
84d19c97d6 docs(plan): session-by-session execution plan from the 2026-07-02 status analysis
Sequences the decided arc (R1 extraction -> D7 sibling -> comparison) into
12 single-session increments (S1-S12), folding in the analysis findings:
truth maintenance (S1), the missing shared method spec (S2), extraction
de-risking + comparison protocol (S3), and per-session verification
criteria + key-assumption tests. Target picture stays the frozen north star.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015PAnzFPa9KXqjQEkw9q5Zs
2026-07-02 17:11:10 +02:00
6f861a0078 feat(persona): build the shared expert-reviewer persona as a framework-neutral Agent Skill
The expert reviewer was only a hardcoded verdict_input dict inside the offline
simulation. Build it as the real, shared artifact target picture §8 calls for:
shared/skills/expert-reviewer/ — a SKILL.md persona prompt (energy-advisor / M&V
role + the realization-gap methodology the validator cannot compute) plus a
canonical references/example-verdict.json. shared/ stays pure data; the MAF side
reads it via portfolio_optimiser.persona.load_persona_example (call-time,
fail-fast) and the Claude-SDK sibling reads the same JSON with its own loader.

This de-stubs the simulation: its persona judgement (decision + rationale + traced
marker) is now sourced from the artifact at call time, not an inline literal — so
the shared persona is genuinely consumed and cannot rot silently. decision is
binary (approved/rejected, the FeedbackContract the run path accepts);
approved_with_adjustment is rejected there and lives only in the bundle seed
frontmatter + the promotion gate, so the realization correction is carried in the
rationale prose.

Load-bearing trio (tests/test_persona_skill_loadbearing.py), each proven RED on its
own detach: structure + framework-neutrality, the example is valid pipeline input
(incl. FeedbackContract, on a throwaway copy), and the simulation's marker follows
the artifact file. Suite 149->152.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHR8iKxJRxDiDfNw8HZmWE
2026-06-30 13:59:42 +02:00
a9144cb9bb feat(sim): offline end-to-end simulation proving the learning loop closes
The primary method proof, offline — a deliberate, cost-driven substitution
for målbilde §11.8's real-model run (the operator runs MAF against no real
model; API for both repos is too costly privately).

`portfolio_optimiser.simulation` drives `run_project` with a scripted
synthetic chat client across two runs separated by a promotion, and shows
the learning loop close end to end:

- ScriptedChatClient subclasses the LAYERED OpenAIChatCompletionClient (not
  bare BaseChatClient — else the always-attached BudgetMiddleware no-ops),
  constructs offline (loopback url + dummy key), role-keys proposer/checker
  replies, and records every prompt into a shared sink.
- simulate_learning_loop: Run A (fresh wiki) -> validated, persona-approved
  verdict carrying a realization marker absent from the bundle -> promote_verdict
  into the OKF wiki -> seed_store_from_bundle re-reads it -> Run B's hypothesis
  prompt carries the marker. An empty-wiki control on Run A proves causality.
- `python -m portfolio_optimiser.simulation` prints an honest trace.

Honesty (§1): this proves the plumbing, the deterministic spine, and that the
learning dataflow closes — NOT that a live LLM would produce the proposal or
verdict (scripted stand-ins). The genuine model-behaviour comparison lives on
the Claude-SDK side (a minimal API run); the scripted client is MAF-side
scaffolding, not part of the framework-neutral shared/ core.

Load-bearing: tests/test_simulation_loadbearing.py goes red when promotion is
detached (the marker never crosses into Run B). Suite 148->149.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHR8iKxJRxDiDfNw8HZmWE
2026-06-30 12:55:15 +02:00