Skip to content

Event 82 · Cognitive Arm A first slice · profile axis history stream + episteme history axis CLI#39

Merged
junjslee merged 1 commit intomasterfrom
event-82-cognitive-arm-a-profile-history
Apr 29, 2026
Merged

Event 82 · Cognitive Arm A first slice · profile axis history stream + episteme history axis CLI#39
junjslee merged 1 commit intomasterfrom
event-82-cognitive-arm-a-profile-history

Conversation

@junjslee
Copy link
Copy Markdown
Owner

Summary

Cognitive Arm A opens. First slice of CP-TEMPORAL-INTEGRITY-EXPANSION-01 — Item 1 (operator profile axes history) + Item 5 partial (episteme history axis CLI). Per cp-v1.1-architectural.md sequencing line 13: TEMPORAL-INTEGRITY + Arm A is the next CP after CHAIN-RECOVERY-PROTOCOL.

Background gap. Operator profile axes are written in-place. When an axis is re-elicited or value-shifted, the OLD claim is overwritten — the trajectory is lost. Phase 12 audit detects drift; operator re-elicits; but the journey from old-claim to new-claim has historically been preserved only in the axis's note field as prose. Concrete pain: Event 68's asymmetry_posture re-elicit lost the trajectory from initial 2026-04-13 elicitation → 2026-04-27 lived-behavior confirmation. This Event makes that trajectory recordable + walkable going forward.

What ships

1. New module src/episteme/_profile_history.py (~270 lines)

Function Purpose
record_change(axis_name, old_value, new_value, reason, ...) Append profile_axis_change envelope to chain
walk_axis_history(axis_name) Return chronological trajectory for axis
list_axes_with_history() Enumerate axes with at least one entry
verify_chain() Integration with episteme chain verify
validate_axis_name(name) Strict against 16-axis schema enumeration
validate_reason(text) Min 15 chars + lazy-token rejection (mirrors _profile_audit_ack.py)

2. New stream ~/.episteme/memory/reflective/profile_history.jsonl

cp7-chained-v1 envelope (zero new chain primitives). Single payload type:

{"type": "profile_axis_change",
 "axis_name": "asymmetry_posture",
 "old_value": "inferred:loss-averse@2026-04-13",
 "new_value": "elicited:loss-averse@2026-04-27 with lived-behavior",
 "reason":    "Re-elicit; lived-behavior closure across Events 65-67.",
 "recorded_at": "2026-04-29T...",
 "recorder":  "junlee",
 "evidence_refs": ["Event 65", "Event 66", "Event 67"]}

Old / new values are free-form strings — operators may record "inferred:loss-averse@2026-04-13" or "20% stop-condition rate" or whatever shape captures the trajectory honestly. History is documentary, not enum-strict.

3. New CLI subcommand episteme history axis

# Walk trajectory for an axis
episteme history axis asymmetry_posture

# List all axes with recorded history
episteme history axis --list

# Record a change manually
episteme history axis asymmetry_posture --record \
    --from "inferred:loss-averse@2026-04-13" \
    --to "elicited:loss-averse@2026-04-27 with lived-behavior" \
    --reason "Re-elicit; lived-behavior closure across Events 65-67." \
    --evidence-refs "Event 65" "Event 66" "Event 67"

4. Chain verify integration

episteme chain verify now enumerates profile_history alongside protocols, deferred_discoveries, pending_contracts, pending_contracts_archive, profile_audit_acks. Smoke-tested: INTACT entries=0 on virgin stream.

Validation discipline

  • axis_name must be one of the 16 declared axes from kernel/OPERATOR_PROFILE_SCHEMA.md v2 schema.
  • reason must be ≥ 15 chars AND must NOT match the lazy-token list (n/a, tbd, ack, 해당 없음, etc. — English + Korean; same pattern as _profile_audit_ack.py).
  • Lazy-token check fires BEFORE min-char check so 'n/a' returns the lazy-token error message.
  • old_value and new_value must be non-empty strings.

What's deferred (named with dependencies)

Component Status Dependency
Item 2 (policy_history.jsonl for cognitive_profile / workflow_policy / agent_feedback) DEFERRED own focused Event; same pattern as Item 1
Item 3 (Reasoning Surface archives — sweep-before-overwrite) DEFERRED couples to RS overwrite path; needs careful hot-path integration
Item 4 (synthesized protocols supersede-with-history) DEFERRED own focused Event; schema evolution on existing protocols.jsonl; "Cognitive Arm A core scope" per spec
Auto-instrumentation in profile-write paths DEFERRED wires _profile_audit.py + profile.py CLI write paths to auto-emit history; load-bearing-by-default version
Item 5 sub-actions for protocol + surface DEFERRED gated on Items 3 + 4

Tests

tests/test_profile_history.py19/19 pass:

Class Cases
ValidateAxisNameTests 4 (valid axis accepted; unknown rejected; empty rejected; non-string rejected)
ValidateReasonTests 5 (lazy n/a; lazy Korean 해당 없음; short reason; substantive accepted; non-string)
RecordChangeTests 4 (valid envelope shape; invalid axis rejected; invalid reason rejected; empty value rejected)
WalkAxisHistoryTests 3 (empty when no file; chronological trajectory; filters other axes)
ListAxesWithHistoryTests 2 (distinct axes; empty when no file)
ChainIntegrityTests 1 (3-entry chain stays intact)

Full test suite green: 653/653 + 21 subtests. No regressions in any prior surface.

Smoke tests verified pre-PR

  • episteme history axis --help renders all flags
  • episteme history axis --list returns clean "no history yet" message on empty store
  • episteme chain verify enumerates profile_history INTACT entries=0 alongside other streams

Soak-invariant

Surface Status
src/episteme/_profile_history.py NEW
src/episteme/cli.py Modified (CLI subcommand + chain-verify integration)
tests/test_profile_history.py NEW
kernel/* / core/hooks/* / core/blueprints/* / templates/* / labs/* UNTOUCHED

Operator next-step (post-merge)

You can immediately use the new CLI to backfill the asymmetry_posture trajectory that was lost on Event-68 re-elicit:

episteme history axis asymmetry_posture --record \
    --from "inferred:loss-averse@2026-04-13" \
    --to "elicited:loss-averse@2026-04-27 with lived-behavior across Events 65-67" \
    --reason "Re-elicit after Phase 12 audit drift detected at Event 48; lived-behavior closure (3 stops + rollbacks against the loss-averse floor)." \
    --evidence-refs "Event 48" "Event 65" "Event 66" "Event 67" "Event 68"

episteme history axis asymmetry_posture
# → walks the trajectory you just recorded

v1.1 cycle queue post-Event-82

  • ✅ CP-FALSIFIABILITY-AUDIT-01 first slice (Event 73)
  • ✅ CP-CHAIN-RECOVERY-PROTOCOL-01 first slice (Event 80)
  • ✅ CP-DESIGN-BEHAVIOR-VERIFICATION-01 + CP-MODEL-PROGRESS-OBSOLESCENCE-01 + CP-PROJECT-GOVERNANCE-CONTINUITY-01 first slices (Event 81)
  • CP-TEMPORAL-INTEGRITY-EXPANSION-01 Item 1 + Item 5 partial (this Event)
  • ⏳ CP-TEMPORAL-INTEGRITY-EXPANSION-01 Item 2 (policy_history) — same pattern, follow-up
  • ⏳ CP-TEMPORAL-INTEGRITY-EXPANSION-01 Item 3 (RS archives) — couples to overwrite path
  • ⏳ CP-TEMPORAL-INTEGRITY-EXPANSION-01 Item 4 (protocols supersede; "Arm A core") — own focused Event
  • ⏳ CP-TEMPORAL-INTEGRITY-EXPANSION-01 auto-instrumentation in profile-write paths
  • ⏳ CP-CONTEXT-AWARE-PROFILE-OVERRIDE-01 (depends on supersede infra established here)
  • ⏳ CP-ACTIVE-GUIDANCE-RANKING-AUDIT-01
  • ⏳ CP-OPERATOR-COGNITIVE-BUDGET-01

Cross-references

  • Spec source: ~/episteme-private/docs/cp-v1.1-architectural.md § CP-TEMPORAL-INTEGRITY-EXPANSION-01 Items 1 + 5
  • Schema source of truth: kernel/OPERATOR_PROFILE_SCHEMA.md (16-axis enumeration)
  • Pattern precedent: src/episteme/_profile_audit_ack.py (Event 78) — same module structure + validation discipline
  • Audit trail: ~/episteme-private/docs/PROGRESS.md Event 82 entry (private)

…eam + episteme history axis CLI (Event 82)

CP-TEMPORAL-INTEGRITY-EXPANSION-01 Item 1 + Item 5 (partial). Opens the
Cognitive Arm A track per cp-v1.1-architectural.md sequencing line 13.

Operator profile axes are written in-place — when an axis is
re-elicited or value-shifted, the OLD claim is overwritten. The
trajectory is lost. Phase 12 audit detects drift (claim vs lived
behavior); operator re-elicits; but the journey from old-claim to
new-claim has historically been preserved only in the axis's `note`
field as prose.

This Event closes the gap.

What ships:

1. New module src/episteme/_profile_history.py
   - record_change(axis_name, old_value, new_value, reason, ...) writes
     a `profile_axis_change` envelope to the new stream.
   - walk_axis_history(axis_name) returns chronological trajectory.
   - list_axes_with_history() returns set of axes with at least one
     recorded change.
   - verify_chain() integration for episteme chain verify.
   - validate_axis_name strict against the 16-axis schema enumeration.
   - validate_reason mirrors _profile_audit_ack.py validation
     discipline (min 15 chars + lazy-token rejection; English + Korean).

2. New stream ~/.episteme/memory/reflective/profile_history.jsonl
   - cp7-chained-v1 envelope (zero new chain primitives).
   - Single payload type: profile_axis_change.

3. New CLI subcommand `episteme history axis`
   - episteme history axis <name>            (read trajectory)
   - episteme history axis --list            (enumerate axes)
   - episteme history axis <name> --record   (write change)
       --from "..." --to "..." --reason "..." [--evidence-refs ...]
   - Old / new values are free-form strings — operators may record
     "inferred:loss-averse@2026-04-13" or "20% stop-condition rate" or
     whatever shape captures trajectory honestly. History is
     documentary, not enum-strict.

4. Chain verify integration
   - `episteme chain verify` now enumerates profile_history alongside
     protocols, deferred_discoveries, pending_contracts,
     pending_contracts_archive, profile_audit_acks.

What's deferred (named with dependencies):

- CP-TEMPORAL-INTEGRITY-EXPANSION-01 Item 2 (cognitive_profile /
  workflow_policy / agent_feedback policy_history.jsonl) — same pattern
  as Item 1; defer to follow-up Event.
- Item 3 (Reasoning Surface archives — sweep-before-overwrite to
  ~/.episteme/memory/reasoning-surfaces/) — couples to RS overwrite path
  which fires every cascade-class op; needs careful integration.
- Item 4 (synthesized protocols supersede-with-history) — schema
  evolution on protocols.jsonl; spec calls this "Cognitive Arm A core
  scope" but Item 1 ships first to establish the supersede pattern
  operator-facing. Defer to follow-up Event.
- Auto-instrumentation in profile-write paths
  (src/episteme/_profile_audit.py + profile.py CLI) — currently
  operators use --record manually; auto-emit on every CLI-driven profile
  change is the load-bearing-by-default version. Defer.
- Item 5 sub-actions for protocol + surface — `episteme history axis`
  ships; `episteme history protocol <context-sig>` and `episteme
  history surface <event-id>` are deferred until Items 3 + 4 land.

Tests at tests/test_profile_history.py — 19/19 pass:
- ValidateAxisNameTests (4 cases)
- ValidateReasonTests (5 cases — including Korean lazy token)
- RecordChangeTests (4 cases)
- WalkAxisHistoryTests (3 cases)
- ListAxesWithHistoryTests (2 cases)
- ChainIntegrityTests (1 case — multi-entry chain stays intact)

Full test suite green: 653/653 + 21 subtests (was baseline; this Event
adds 19 cases without regressions in any prior surface).

Live smoke tests verified:
- episteme history axis --help renders all flags
- episteme history axis --list returns clean message when empty
- episteme chain verify enumerates profile_history alongside other streams
  with INTACT entries=0 on a virgin stream

Soak-protected surfaces touched: ZERO. Module + CLI + tests only.
core/hooks/* / core/blueprints/* / kernel/* / templates/* / labs/*
UNTOUCHED.

Operator can immediately use --record CLI to backfill the
asymmetry_posture trajectory that was lost on Event-68 re-elicit:

  episteme history axis asymmetry_posture --record \
    --from "inferred:loss-averse@2026-04-13" \
    --to "elicited:loss-averse@2026-04-27 with lived-behavior" \
    --reason "Re-elicit; lived-behavior closure across Events 65-67." \
    --evidence-refs "Event 65" "Event 66" "Event 67"
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
episteme Ready Ready Preview, Comment Apr 29, 2026 6:30am

@junjslee junjslee merged commit 20b9ffd into master Apr 29, 2026
5 checks passed
@junjslee junjslee deleted the event-82-cognitive-arm-a-profile-history branch April 29, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant