Commit Graph

17 Commits

Author SHA1 Message Date
github-actions[bot] 57ec68ecf9 style: auto-fix formatting 2026-07-06 14:22:05 +00:00
Maxim 157d9fc723 feat(banking): reproducible dev-license mint helper (self-hosted memory)
Phase 3 of the banking->Intelligence-main migration. Self-hosted Intelligence
gates the paid `memory` feature behind a signed offline license; a locally-built
(unbaked) app-api trusts a runtime BAKED_LICENSE_KEYS_JSON, so a throwaway
keypair can sign an enterprise license with features.memory=true.

- scripts/mint-dev-license.mjs: prints (or --write upserts into .env)
  COPILOTKIT_LICENSE_TOKEN + BAKED_LICENSE_KEYS_JSON + INTELLIGENCE_DEPLOYMENT_MODE.
  Drives the signer from the PRIVATE Intelligence source via INTELLIGENCE_REPO
  (same coupling the docker-compose image build already has) rather than
  vendoring any signing code into this public repo. No secret is embedded; the
  script is dev-only and never imported by the app runtime.
- .env.example: documents BOTH the managed path (CopilotKit-issued token, no
  baked key — the eventual hosting target) and the self-hosted dev path, so the
  demo is not locked to the local stack.
- package.json: add `mint-dev-license` script.

Replaces the ephemeral Intelligence/tmp/mint-banking-license.ts. .env stays
gitignored; nothing sensitive is committed. Local-only until verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:20:01 +02:00
Maxim 3b1e04275e chore(banking): rename memory kinds to Intelligence main enum
Phase 2 of the banking->Intelligence-main migration. Main's memory lib
(libs/memory/src/types.ts) closes MemoryKind to topical|episodic|operational;
the demo was authored against the legacy semantic|procedural names, which the
backend now rejects/misfiles. Rename across the whole surface:
- agent prompt (route.ts CLASSIFY + SAVE-THE-PROCEDURE): semantic->topical,
  procedural->operational
- recorder instruction (copilot-context.tsx), learning-tab dual-read dropped,
  memory-tab KIND_COLORS, memory unit-test fixture
- smokes (facts + drift) and the e2e spec seed + fixtures comment

Only true kind: values renamed; "semantic recall"/"top-k semantic search"
mechanism descriptions left intact (recall is vector search regardless of enum).
aimock fixture re-record was a no-op: the one fixture pins the recall-and-apply
arc (no kind: values); the seed is REST-side in the spec.

Verified: pnpm test:unit 47/47, tsc --noEmit clean, eslint clean on touched files.
Local-only until the full migration is verified against the main stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:20:00 +02:00
github-actions[bot] 40fe2c64a6 style: auto-fix formatting 2026-07-03 18:15:03 +00:00
Maxim ca5f6f7da9 test(banking): use UUID thread/run ids in smokes (backend validates thread id as UUID) 2026-07-03 17:26:39 +02:00
Maxim 277b037193 test(banking): smokes preflight the demo dev server for a clear 'run pnpm dev' error 2026-07-03 17:23:45 +02:00
Maxim 84095d63ec test(banking): add /mcp readiness gate to memory smokes; document backend boot-window flake 2026-07-03 17:17:50 +02:00
Maxim fba5b085c3 test(banking): drain full turn in drift smoke so rule-9 negative save assertion is reliable 2026-07-03 16:28:24 +02:00
Maxim 6bbe4bb819 test(banking): add real-LLM general-memory smoke (save/no-save/recall/isolation) 2026-07-03 16:12:16 +02:00
Maxim c401b3d4e3 test(banking): drift smoke asserts identity and no spurious save in teach flow 2026-07-03 16:12:12 +02:00
Maxim ad922750cf fix(showcase): align banking memory docs/smoke to kind procedural
The durable memory feature saves kind:"procedural" (route.ts:150) but the
README and drift-smoke script described/seeded kind:"operational", a
doc/code contradiction. Update both to procedural. The learning-tab
back-compat (operational || procedural) is intentionally left untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim 2d9275da1f fix(showcase): correct memory-learning spec path in banking docs
The README, .env.example, and memory-drift-smoke.mjs referenced a
non-existent path 'tests/e2e/memory-learning.spec.ts'. The actual spec
lives at 'e2e/memory-learning.spec.ts' (matching the test:self-learning
script in package.json). Corrected all three references.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
github-actions[bot] 5f77e8696a style: auto-fix formatting 2026-07-02 19:37:31 +02:00
Maxim cdcd5460d6 test(showcase): deterministic aimock+Playwright cross-thread memory proof (FOR-149)
AUTHORED + statically validated (playwright --list compiles spec+config, fixtures/
package JSON valid, launcher syntax OK). NOT yet green-verified — needs aimock
installed (pnpm i), the docker memory stack up, and the dev server in Intelligence
mode (multi-process; not runnable in the current sandbox). Each file carries a
'VERIFY ON FIRST GREEN RUN' checklist for the shakedown.

- e2e/memory-learning.spec.ts: seeds the procedure via REST (recall-half isolation
  per the plan), drives a fresh thread, asserts recall->unlock with no recording
  offer + the over-limit gate lifted. Save half stays HITL+LLM (drift smoke / manual).
- e2e/fixtures/memory-learning.fixtures.json: pins recall_memory -> openPolicyException
  -> finalizePolicyException -> approveTransaction.
- e2e/aimock-server.mjs: aimock launcher (programmatic, CLI fallback documented).
- playwright.config.ts: webServer array (aimock + dev in Intelligence mode, OPENAI_BASE_URL->aimock).
- package.json: +@copilotkit/aimock devDep; test:self-learning -> the spec.
- remove scripts/self-learning-smoke.mjs (dead #192 distill path).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:32 +02:00
Maxim 177a68f7d4 docs(showcase): memory-based durable-learning runbook + real-LLM recall drift smoke
- README: replace dead sl-worker/knowledge/annotate Phase-C section with the
  memory runbook (docker compose one-command stack, host-TEI override for Apple
  Silicon, 715x ports, .env, cross-thread+cross-persona FOR-149 walkthrough,
  aimock E2E + drift-smoke testing notes)
- scripts/memory-drift-smoke.mjs: non-gating real-LLM tripwire that the live model
  still emits recall_memory on a fresh-thread over-limit request (save half is
  HITL-gated; covered by the manual walkthrough + aimock E2E)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:30 +02:00
GeneralJerel 8e7c6e2fb6 feat(showcase): narrate the self-learning teach-a-workflow loop
Drive the FOR-137 self-learning story as an agent-orchestrated, narrated loop. When an
over-limit approval is rejected, the agent offers to record a workflow; the officer
demonstrates by filing a policy exception; the agent summarizes and saves the procedure;
then it applies that procedure itself to a different over-limit charge. Same-session recall
works by echoing the learned procedure back into the thread.

page.tsx: three new human-in-the-loop tools (offerWorkflowRecording,
recordExceptionDemonstration, saveLearnedWorkflow) plus a transactions agent-readable so the
agent resolves a charge the user names to the right id instead of guessing.
openPolicyException now returns the new exception id, and the agent-driven exception tools
are followUp:true so the recall chain (open then finalize then approve) does not stall.

route.ts: TEACH & RECALL prompt rules and an ACTION DISCIPLINE carve-out. The prompt does
not restate the unlock procedure, preserving the learning invariant.

policy-exception-inline.tsx: surface the demonstrated exception code via onFiled(code).

scripts/over-limit-gate-smoke.mjs: regression guard proving only a finalized
justifying-code exception lifts the policy-limit gate.

Verified end-to-end in OSS dev mode (lint and build green): the demonstration clears the
Google Ads charge and recall clears the AWS charge with a single successful approve.
2026-06-15 06:05:27 -07:00
GeneralJerel 6a7f1187f7 test(showcase): add self-learning smoke script (record, distill, recall)
scripts/self-learning-smoke.mjs proves the banking demo's recording seam
end-to-end against a running Intelligence backend: posts four teaching
actions through the demo BFF /api/copilotkit/annotate (the platform
requires UUID clientEventIds), optionally runs one sl-worker sweep when
INTELLIGENCE_REPO is set, and asserts the distilled vendor policy reads
back through the platform /mcp knowledge tool. Wired as the
test:self-learning package script and documented in the README.

Verified live: PASS 6/6 against Intelligence @ mme/learn-from-user-activity
(records as rows 13-16, sweep editCount=0 steady-state, recall returns the
pre-cleared vendor policy).
2026-06-11 04:54:23 -07:00