Skip to content

feat: add privacy-first Codex to OKF migration - #1843

Open
Yutre3 wants to merge 7 commits into
moorcheh-ai:mainfrom
Yutre3:feat/codex-okf-migration
Open

feat: add privacy-first Codex to OKF migration#1843
Yutre3 wants to merge 7 commits into
moorcheh-ai:mainfrom
Yutre3:feat/codex-okf-migration

Conversation

@Yutre3

@Yutre3 Yutre3 commented Aug 10, 2026

Copy link
Copy Markdown

Bounty submission

Submission for #1609 — Path B: a new migration source (OpenAI Codex Desktop/CLI rollout JSONL).

This PR adds a reproducible, privacy-first adapter that turns a genuine Codex rollout into typed, portable OKF memories that Memanto can import and re-export.

What makes this submission different

  • Realistic source: the publishable fixture is derived from a genuine Codex Desktop rollout and preserves the original 810-record shape for auditability.
  • Privacy allow-list: only visible user/assistant prose is eligible. Developer prompts, reasoning, tool traffic, runtime state, environment metadata, raw session/message identifiers, local paths, and secret-like values are excluded, pseudonymized, or redacted.
  • Semantic typing: soft-wrapped user fragments are merged before one message is split into focused goal, instruction, decision, observation, artifact, or fact memories.
  • Portable proof: 15/15 memories survive Memanto's official OKF loader → mapper → exporter path with resource, type, title, and content preserved.
  • Retrieval proof: 4/4 golden questions retrieve the expected memory and type.
  • Safe deterministic output: canonical SHA-256 verification, POSIX source paths, strict type validation, tool-owned output markers, staging/backup replacement, and deterministic fallback timestamps.

Reproduce

cd examples/migrations/codex-to-okf
./run.sh

Windows: ./run.ps1

The command regenerates the OKF bundle with explicit safe replacement, runs golden retrieval validation, runs the official Memanto round-trip validation, then executes Memanto's shipped OKF dry-run and verifies 15 mapped, 0 skipped.

Checked-in evidence

  • sample_output/okf-bundle/migration-report.json: 810 source records audited, 12 visible messages included, 15 typed memories written.
  • sample_output/recall-parity.json: 4/4 golden questions, 100% recall parity.
  • sample_output/portability-parity.json: 15/15 official loader/mapper/exporter round trips, 100% field parity.
  • sample_output/reexported-okf/: resulting portable OKF tree.
  • tests/test_codex_okf_example.py: privacy/export, output-safety, golden retrieval, and official portability gates.

Validation performed locally:

5 passed
ruff check: passed
ruff format --check: passed

Live Moorcheh validation

Two generated OKF memory files were uploaded to a dedicated Moorcheh Text namespace. A semantic query asking for the minimum economic objective returned $200 and cited the exact generated goal-memory filename and its pseudonymized source provenance. No API key or private rollout metadata is included in this PR.

Social showcase

A separate campaign X account published the corrected 80-second demo and tags @moorcheh_ai: https://x.com/nobrenobre86479/status/2086955536763740248

Live sourced Moorcheh recall proof: https://x.com/nobrenobre86479/status/2086975140928127092

The pinned video thread includes the privacy audit and 15/15 portability breakdown; the submission also replies directly beneath Moorcheh AI’s official bounty announcement.

Demo

Public video: watch or download demo.m4v

The 80-second demo covers conversion, privacy filtering, typed output, golden recall, and the official Memanto re-export parity gate. Run make_demo_video.py to reproduce it.

Review follow-up

Commits 98455eb, 2732767, bde1415, and 4d7adbc address every automated review pass: pseudonymization, deterministic hashing, unterminated-block filtering, fragment merging, type validation, race-hardened replacement, exclusion of unscoped consent, LF-canonical source provenance, deterministic re-exported Markdown, and a non-vacuous checked-in evidence test. The safe output contains 15 durable memories; the source rollout remains unchanged and auditable.

AI assistance disclosure

Codex assisted extensively with implementation, tests, documentation, review fixes, and video rendering. The code, fixture, hashes, and validation outputs are intentionally reproducible for maintainer audit. Human review of the privacy policy and final submission is required before award acceptance.

Scope

This is intentionally an example migration rather than a new runtime dependency. The converter uses Python's standard library; the demo-video renderer is isolated in requirements-demo.txt.

Related to #1609.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added a Codex-to-OKF migration workflow for creating portable knowledge bundles from JSONL rollouts.
    • Includes privacy filtering, redaction, memory categorization, provenance, hashes, and audit reports.
    • Added round-trip recall and portability validation with parity reporting.
    • Added shell and PowerShell workflows, sanitized sample data, and optional demo-video generation.
  • Documentation

    • Added migration guidance, reproducible commands, sample outputs, and known limitations.
  • Tests

    • Added coverage for privacy handling, recall validation, bundle replacement, and portability.

@github-actions github-actions Bot added the Bounty#6 Migration, OKF label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bd878a88-dc83-4cb2-b014-81b4b825b516

📥 Commits

Reviewing files that changed from the base of the PR and between 2732767 and 4d7adbc.

⛔ Files ignored due to path filters (1)
  • examples/migrations/codex-to-okf/demo.m4v is excluded by !**/*.m4v
📒 Files selected for processing (26)
  • .gitattributes
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-012-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-015-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-006-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-008-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-009-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-010-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-005-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-007-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-011-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-013-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-014-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • tests/test_codex_okf_example.py
🚧 Files skipped from review as they are similar to previous changes (26)
  • .gitattributes
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-009-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-014-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-005-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-010-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-008-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-012-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-015-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-006-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-011-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • tests/test_codex_okf_example.py
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-013-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-007-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md

📝 Walkthrough

Walkthrough

This PR adds a privacy-focused Codex JSONL-to-OKF migration example. It includes sanitization, semantic memory mapping, safe bundle replacement, recall and portability validation, reproducible scripts, demo video generation, tests, and generated evidence.

Changes

Codex-to-OKF migration

Layer / File(s) Summary
Privacy-aware rollout extraction and bundle export
examples/migrations/codex-to-okf/codex_to_okf.py, make_sanitized_fixture.py, sample_data/*, sample_output/okf-bundle/*
Filters visible messages, removes injected content, redacts sensitive values, classifies memories, writes OKF bundles, and records audit metadata.
Recall and portability validation
validate_roundtrip.py, validate_portability.py, golden_qa.json, sample_output/recall-parity.json, sample_output/portability-parity.json, sample_output/reexported-okf/*, tests/test_codex_okf_example.py
Validates bundle structure, golden-question retrieval, mapped memory fidelity, safe replacement, and sample parity.
Reproducible workflows and demonstration
run.sh, run.ps1, make_demo_video.py, README.md, requirements*.txt, .gitattributes
Documents and runs migration, validation, fixture regeneration, Memanto dry runs, and optional terminal-video rendering.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CodexJSONL
  participant CodexToOKF
  participant OKFBundle
  participant RoundtripValidator
  participant PortabilityValidator
  CodexJSONL->>CodexToOKF: Read sanitized rollout records
  CodexToOKF->>OKFBundle: Write typed memories and audit reports
  RoundtripValidator->>OKFBundle: Validate structure and golden-question recall
  PortabilityValidator->>OKFBundle: Map and re-export memories
  PortabilityValidator->>OKFBundle: Compare resources, types, titles, and content
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a privacy-first Codex-to-OKF migration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/migrations/codex-to-okf/codex_to_okf.py`:
- Around line 88-99: Update normalize_timestamp so missing or invalid timestamps
no longer use datetime.now(timezone.utc). Replace that fallback with a
deterministic fixed timestamp, or reject the record, while preserving the
existing normalization behavior for valid timestamps.
- Around line 308-323: Apply the privacy allow-list consistently across all
listed sites: in examples/migrations/codex-to-okf/codex_to_okf.py lines 308-323,
replace raw message and session identifiers used by write_memory in resource and
x_memanto.source_ref with safe pseudonyms; in lines 365-425 of the same file,
omit session_id, originator, cli_version, and raw message IDs from the public
report; in examples/migrations/codex-to-okf/make_sanitized_fixture.py lines
37-38, omit raw originator and cli_version from the checked-in fixture.
- Around line 101-108: Update strip_injected_blocks to match each opening tag
through its closing tag or the end of the input, so unterminated INJECTED_BLOCKS
entries are removed while preserving the existing case-insensitive, multiline
behavior and final trimming.
- Around line 48-50: Add a `/root/*` redaction pattern alongside the existing
`posix_home_path` pattern in the migration redaction configuration, ensuring
matching paths are replaced with `<REDACTED_PATH>` while preserving the current
`/home/*` and `/Users/*` behavior.

In `@examples/migrations/codex-to-okf/make_sanitized_fixture.py`:
- Line 28: Update the timestamp selection in the fixture-generation flow around
read_rollout() so rollouts with no visible messages do not access messages[0].
Preserve the session metadata timestamp when available, and otherwise use a
deterministic fallback timestamp when both it and eligible messages are absent,
while still using the first visible message timestamp when present.

In `@examples/migrations/codex-to-okf/run.ps1`:
- Around line 9-13: Update the converter’s write_bundle flow to require an
explicit replacement option and verify a tool-owned marker before deleting an
existing output directory. After that safeguard exists, forward the replacement
intent from both examples/migrations/codex-to-okf/run.ps1 lines 9-13 and
examples/migrations/codex-to-okf/run.sh lines 6-10; both sites require the same
argument forwarding change.

In `@examples/migrations/codex-to-okf/sample_data/codex-rollout-sanitized.jsonl`:
- Line 1: Remove or explicitly redact the originator and cli_version fields from
the sanitized fixture’s session_meta payload, and update write_bundle so it does
not copy these metadata values into migration-report.json. Preserve all
unrelated session metadata and report fields.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-005-de-ahi-en-mas-haz-todo-lo-que-i.md`:
- Line 19: Merge the fragments in
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-005-de-ahi-en-mas-haz-todo-lo-que-i.md:19-19
and
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-006-necesites-y-ocupes-tienes-luz-verde-en-todo.md:19-19
into one complete memory document, keeping the continuation with the first
fragment and removing the standalone second document so export stores one source
sentence and reports one memory.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md`:
- Around line 2-19: Classify this response constraint as an instruction rather
than a goal: update both the frontmatter type and x_memanto.type fields in the
migration adapter, then regenerate the OKF bundle so the sample output reflects
instruction classification while preserving the separate monetary objective.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md`:
- Around line 21-22: Remove the “Visible phase: commentary” footer from the
rendered memory bodies and regenerate the artifacts. Apply this change at lines
21-22 in
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-012-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-007-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-009-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-013-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md,
and
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-015-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json`:
- Around line 3-9: Remove the non-essential originator and cli_version session
environment fields from write_bundle and regenerate
examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
(anchor lines 3-9). Update tests/test_codex_okf_example.py (lines 129-140) to
scan every emitted artifact, including JSON reports, for injected metadata
values. Keep the privacy statement in
examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
(lines 19-21) only once the regenerated JSON satisfies the same boundary.
- Line 143: Update the bundle_sha256 field in both migration report sample
outputs to the canonical hash
1a8907cceac19b61c5edce468eb3acb5a9bd100bb55c54a7f750e36251a7e1a7.

In `@examples/migrations/codex-to-okf/validate_portability.py`:
- Around line 43-52: Update _normalize_generated_markdown to normalize only OKF
source values to POSIX path separators before writing Markdown, while preserving
all other content normalization. Regenerate the affected outputs in
examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
(lines 29-62), decision/decision.md (lines 28-61), fact/fact.md (lines 25-54),
and goal/goal.md (lines 25-146) after applying the fix; these files require
regenerated content only.

In `@examples/migrations/codex-to-okf/validate_roundtrip.py`:
- Around line 87-98: Update the validation loop in validate_roundtrip to require
a supported memory type, ensure x_memanto is a mapping before accessing it, and
verify x_memanto.type matches metadata.type. Record these as structural_errors
and continue safely without crashing on scalar x_memanto values, while
preserving the existing source and required-field checks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f73de7bc-9685-4fda-896f-1738ed2a6209

📥 Commits

Reviewing files that changed from the base of the PR and between 49c8ccd and cd31b68.

⛔ Files ignored due to path filters (1)
  • examples/migrations/codex-to-okf/demo.m4v is excluded by !**/*.m4v
📒 Files selected for processing (52)
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/codex_to_okf.py
  • examples/migrations/codex-to-okf/golden_qa.json
  • examples/migrations/codex-to-okf/make_demo_video.py
  • examples/migrations/codex-to-okf/make_sanitized_fixture.py
  • examples/migrations/codex-to-okf/requirements-demo.txt
  • examples/migrations/codex-to-okf/requirements.txt
  • examples/migrations/codex-to-okf/run.ps1
  • examples/migrations/codex-to-okf/run.sh
  • examples/migrations/codex-to-okf/sample_data/codex-rollout-sanitized.jsonl
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-014-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-017-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-008-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-010-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-005-de-ahi-en-mas-haz-todo-lo-que-i.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-006-necesites-y-ocupes-tienes-luz-verde-en-todo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-012-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-007-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-009-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-013-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-015-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-016-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/recall-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/.codex-okf-roundtrip
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/fact/fact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/fact/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/overview.md
  • examples/migrations/codex-to-okf/validate_portability.py
  • examples/migrations/codex-to-okf/validate_roundtrip.py
  • tests/test_codex_okf_example.py

Comment thread examples/migrations/codex-to-okf/codex_to_okf.py
Comment thread examples/migrations/codex-to-okf/codex_to_okf.py
Comment thread examples/migrations/codex-to-okf/codex_to_okf.py
Comment thread examples/migrations/codex-to-okf/codex_to_okf.py
Comment thread examples/migrations/codex-to-okf/make_sanitized_fixture.py Outdated
Comment on lines +21 to +22
---
Source role: `assistant` · Visible phase: `commentary`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove rollout phase metadata from rendered memory bodies.

Visible phase: commentary persists rollout runtime metadata after the migration. This conflicts with the stated privacy contract. validate_roundtrip.py also indexes this footer as document body text.

  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md#L21-L22: remove the visible-phase footer and regenerate the artifact.
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-012-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md#L21-L22: remove the visible-phase footer and regenerate the artifact.
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-007-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md#L21-L22: remove the visible-phase footer and regenerate the artifact.
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-009-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md#L21-L22: remove the visible-phase footer and regenerate the artifact.
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-013-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md#L21-L22: remove the visible-phase footer and regenerate the artifact.
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-015-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md#L21-L22: remove the visible-phase footer and regenerate the artifact.
📍 Affects 6 files
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md#L21-L22 (this comment)
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-012-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md#L21-L22
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-007-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md#L21-L22
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-009-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md#L21-L22
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-013-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md#L21-L22
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-015-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md#L21-L22
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md`
around lines 21 - 22, Remove the “Visible phase: commentary” footer from the
rendered memory bodies and regenerate the artifacts. Apply this change at lines
21-22 in
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-011-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-012-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-007-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-009-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md,
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-013-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md,
and
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-015-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md.

"text": "<omitted; stored in OKF>"
}
],
"bundle_sha256": "cb4ef8e1d689e723db95e4015dddcfa4e33fae572bc5a8f6c1d498107f47cee2"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

ast-grep outline examples/migrations/codex-to-okf/codex_to_okf.py --items all
rg -n -C 12 'def tree_hash|tree_hash\(output\)|migration-report\.json' \
  examples/migrations/codex-to-okf/codex_to_okf.py

Repository: moorcheh-ai/memanto

Length of output: 4017


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

sed -n '337,465p' examples/migrations/codex-to-okf/codex_to_okf.py
printf '\n--- bundle files ---\n'
find examples/migrations/codex-to-okf/sample_output/okf-bundle -type f -print | sort
printf '\n--- report hash and independently computed canonical hash ---\n'
python3 - <<'PY'
from hashlib import sha256
from pathlib import Path
import json

root = Path("examples/migrations/codex-to-okf/sample_output/okf-bundle")
report_path = root / "migration-report.json"
report = json.loads(report_path.read_text(encoding="utf-8"))
digest = sha256()
included = []
for path in sorted(
    p for p in root.rglob("*")
    if p.is_file() and p.name not in {"migration-report.json", "migration-report.md"}
):
    included.append(path.relative_to(root).as_posix())
    digest.update(path.relative_to(root).as_posix().encode())
    digest.update(b"\0")
    digest.update(path.read_bytes())
    digest.update(b"\0")
print("report bundle_sha256:", report.get("bundle_sha256"))
print("computed canonical hash:", digest.hexdigest())
print("matches:", report.get("bundle_sha256") == digest.hexdigest())
print("hashed files:", included)
PY

Repository: moorcheh-ai/memanto

Length of output: 9781


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- working-tree status ---'
git status --short

printf '%s\n' '--- targeted diff summary ---'
git diff --stat -- \
  examples/migrations/codex-to-okf/codex_to_okf.py \
  examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json \
  examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md

printf '%s\n' '--- hash occurrences ---'
rg -n 'cb4ef8e1d689e723db95e4015dddcfa4e33fae572bc5a8f6c1d498107f47cee2|1a8907cceac19b61c5edce468eb3acb5a9bd100bb55c54a7f750e36251a7e1a7' .

printf '%s\n' '--- independent byte-level hash inputs ---'
python3 - <<'PY'
from hashlib import sha256
from pathlib import Path

root = Path("examples/migrations/codex-to-okf/sample_output/okf-bundle")
paths = sorted(
    p for p in root.rglob("*")
    if p.is_file() and p.name not in {"migration-report.json", "migration-report.md"}
)
for mode in ("relative-posix", "relative-native", "basename"):
    digest = sha256()
    for path in paths:
        name = (
            path.relative_to(root).as_posix()
            if mode == "relative-posix"
            else str(path.relative_to(root))
            if mode == "relative-native"
            else path.name
        )
        digest.update(name.encode())
        digest.update(b"\0")
        digest.update(path.read_bytes())
        digest.update(b"\0")
    print(mode, digest.hexdigest())
PY

Repository: moorcheh-ai/memanto

Length of output: 857


Regenerate the sample bundle with the correct bundle_sha256. The canonical hash is 1a8907cceac19b61c5edce468eb3acb5a9bd100bb55c54a7f750e36251a7e1a7. Update both migration reports.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json`
at line 143, Update the bundle_sha256 field in both migration report sample
outputs to the canonical hash
1a8907cceac19b61c5edce468eb3acb5a9bd100bb55c54a7f750e36251a7e1a7.

Comment thread examples/migrations/codex-to-okf/validate_portability.py
Comment thread examples/migrations/codex-to-okf/validate_roundtrip.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
examples/migrations/codex-to-okf/codex_to_okf.py (1)

56-58: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Redact workspace paths.

The current patterns redact home directories but not common workspace paths such as /workspace/... or /workspaces/.... Visible prose containing these paths can be exported into memory bodies. Extend the path-redaction policy and add fixtures for POSIX and Windows workspace roots.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/migrations/codex-to-okf/codex_to_okf.py` around lines 56 - 58,
Extend the path-redaction patterns near posix_home_path to match both POSIX
workspace roots (/workspace/... and /workspaces/...) and their Windows
equivalents, while preserving existing home-path redaction behavior. Add
fixtures covering POSIX and Windows workspace paths and verify they are redacted
from exported memory bodies.
examples/migrations/codex-to-okf/make_sanitized_fixture.py (1)

45-59: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Preserve the original JSONL record order.

Lines 45-59 emit every visible message before Lines 61-97 emit any redacted record. A rollout with tool or runtime records between messages loses its original sequence.

Scan the source once and replace each eligible message in place. Keep redacted records at their original positions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/migrations/codex-to-okf/make_sanitized_fixture.py` around lines 45 -
59, Update the record-building logic around the message iteration to scan source
records once and emit each eligible message or redacted record in its original
JSONL position. Replace messages in place while preserving tool and runtime
records’ ordering, rather than appending all visible messages before redacted
records.
examples/migrations/codex-to-okf/README.md (1)

148-154: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use one demo filename and extension.

The command writes codex-okf-demo.mp4, but the linked checked-in artifact is demo.m4v. The documented command does not regenerate the linked file. Use the same path in the command, link, and checked-in artifact.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/migrations/codex-to-okf/README.md` around lines 148 - 154, Use a
single demo filename and extension consistently in the README: update the
make_demo_video.py command, the linked artifact reference, and the checked-in
artifact description so they all point to the same output path.
examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md (1)

60-87: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not classify assistant plans as instruction.

The assistant message contains cero uso, so the migration classifies it as instruction. Consumers inject all instruction memories as rules to always honour. Restrict instruction mapping to user messages, or map assistant plans to decision, artifact, or observation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md`
around lines 60 - 87, Update the migration classification logic that produces
the reexported memory metadata so assistant-authored plans are never mapped to
type “instruction”; restrict instruction classification to user messages and
classify assistant plans as the appropriate non-instruction type such as
decision, artifact, or observation.
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-010-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md (1)

2-19: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Fix the classifier and regenerate both records.

message-006 should be decision because it records a route change. message-007 should be observation because it reports a discovery and ongoing validation. The classifier incorrectly matches genera inside general and gives objetivo precedence over observation markers. Update the classifier and tests, then update type, x_memanto.type, directory placement, and migration evidence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-010-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md`
around lines 2 - 19, Update the classifier and its tests so whole-word matching
does not classify “genera” within “general,” and ensure observation markers take
precedence over the generic “objetivo” rule. Regenerate message-006 as a
decision and message-007 as an observation; update both records’ type and
x_memanto.type, move them from the goal directory to the corresponding
decision/observation directories, and refresh the migration evidence. Apply
these changes to
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-010-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
(lines 2-19) and
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-011-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
(lines 2-19).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/migrations/codex-to-okf/codex_to_okf.py`:
- Around line 385-392: Update the migration replacement flow around target and
marker to bind ownership validation to the exact filesystem object being
replaced, preventing target path swaps after validation. After renaming target
to its backup, validate the backup’s owner marker by descriptor or inode before
recursively deleting it; if validation fails, restore the backup and abort.
Ensure shared-directory operations cannot substitute a different target between
validation and replacement.

In `@examples/migrations/codex-to-okf/README.md`:
- Around line 74-83: Align the codex-to-okf migration fixture, generated bundle,
reports, demo output, and README with the 17-memory acceptance target by adding
the missing source memory and regenerating all artifacts; preserve the
historical imported message mentioning 16. Also update the demo command and
README reference to use the same filename and extension instead of mixing
codex-okf-demo.mp4 and demo.m4v.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-005-de-ahi-en-mas-haz-todo-lo-que-i-necesites-y-ocupes-tiene.md`:
- Line 2: Reclassify the converted memory currently marked with type `fact` so
broad authorization is not persisted as objective data; store it as scoped,
time-limited consent using the schema’s supported type, or exclude it when that
scope cannot be represented.

In
`@examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/overview.md`:
- Line 41: Remove the wall-clock timestamp from the generated visualization
metadata in the re-exported OKF artifact, or replace it with a deterministic UTC
value derived from source metadata. Ensure repeated exports produce identical
overview.md content when the source metadata is unchanged.

---

Outside diff comments:
In `@examples/migrations/codex-to-okf/codex_to_okf.py`:
- Around line 56-58: Extend the path-redaction patterns near posix_home_path to
match both POSIX workspace roots (/workspace/... and /workspaces/...) and their
Windows equivalents, while preserving existing home-path redaction behavior. Add
fixtures covering POSIX and Windows workspace paths and verify they are redacted
from exported memory bodies.

In `@examples/migrations/codex-to-okf/make_sanitized_fixture.py`:
- Around line 45-59: Update the record-building logic around the message
iteration to scan source records once and emit each eligible message or redacted
record in its original JSONL position. Replace messages in place while
preserving tool and runtime records’ ordering, rather than appending all visible
messages before redacted records.

In `@examples/migrations/codex-to-okf/README.md`:
- Around line 148-154: Use a single demo filename and extension consistently in
the README: update the make_demo_video.py command, the linked artifact
reference, and the checked-in artifact description so they all point to the same
output path.

In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-010-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md`:
- Around line 2-19: Update the classifier and its tests so whole-word matching
does not classify “genera” within “general,” and ensure observation markers take
precedence over the generic “objetivo” rule. Regenerate message-006 as a
decision and message-007 as an observation; update both records’ type and
x_memanto.type, move them from the goal directory to the corresponding
decision/observation directories, and refresh the migration evidence. Apply
these changes to
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-010-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
(lines 2-19) and
examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-011-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
(lines 2-19).

In
`@examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md`:
- Around line 60-87: Update the migration classification logic that produces the
reexported memory metadata so assistant-authored plans are never mapped to type
“instruction”; restrict instruction classification to user messages and classify
assistant plans as the appropriate non-instruction type such as decision,
artifact, or observation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ca3c191e-de72-4c23-86cb-30914d12b2c5

📥 Commits

Reviewing files that changed from the base of the PR and between 72612aa and 98455eb.

⛔ Files ignored due to path filters (1)
  • examples/migrations/codex-to-okf/demo.m4v is excluded by !**/*.m4v
📒 Files selected for processing (44)
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/codex_to_okf.py
  • examples/migrations/codex-to-okf/make_demo_video.py
  • examples/migrations/codex-to-okf/make_sanitized_fixture.py
  • examples/migrations/codex-to-okf/run.ps1
  • examples/migrations/codex-to-okf/run.sh
  • examples/migrations/codex-to-okf/sample_data/codex-rollout-sanitized.jsonl
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/.codex-okf-bundle
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-013-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-016-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-007-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-009-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/fact/20260810172828-005-de-ahi-en-mas-haz-todo-lo-que-i-necesites-y-ocupes-tiene.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-010-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-011-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-006-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-008-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-012-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-014-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-015-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/recall-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/fact/fact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/fact/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/overview.md
  • examples/migrations/codex-to-okf/validate_portability.py
  • examples/migrations/codex-to-okf/validate_roundtrip.py
  • tests/test_codex_okf_example.py
🚧 Files skipped from review as they are similar to previous changes (17)
  • examples/migrations/codex-to-okf/sample_data/codex-rollout-sanitized.jsonl
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/fact/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/run.sh
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/run.ps1
  • examples/migrations/codex-to-okf/validate_roundtrip.py
  • examples/migrations/codex-to-okf/sample_output/recall-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/index.md
  • examples/migrations/codex-to-okf/make_demo_video.py
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md

Comment thread examples/migrations/codex-to-okf/codex_to_okf.py Outdated
Comment on lines +74 to +83
6. verifies 16/16 resource, type, title, and content parity; and
7. runs Memanto's shipped OKF dry-run and verifies 16 mapped, 0 skipped.

Expected result:

```text
4/4 golden questions passed
recall_parity_percent: 100.0
portability parity: 16/16 (100.0%)
Memanto dry run: 16 mapped, 0 skipped

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- candidate files ---'
git ls-files | rg '(^|/)(README\.md|.*codex.*okf.*|.*demo.*\.(m4v|mp4))$' || true

printf '%s\n' '--- README references ---'
rg -n -C 6 '16/16|17/17|16 mapped|17 mapped|codex-okf-demo|demo\.m4v|demo\.mp4|historical|imported message' examples/migrations/codex-to-okf/README.md || true

printf '%s\n' '--- nearby README sections ---'
sed -n '55,155p' examples/migrations/codex-to-okf/README.md

printf '%s\n' '--- matching repository references ---'
rg -n -C 3 'codex-okf-demo|demo\.m4v|demo\.mp4|16/16|17/17|16 mapped|17 mapped' . --glob '!node_modules' --glob '!dist' --glob '!build' || true

Repository: moorcheh-ai/memanto

Length of output: 20100


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- relevant file outlines ---'
ast-grep outline examples/migrations/codex-to-okf/validate_portability.py
ast-grep outline examples/migrations/codex-to-okf/validate_roundtrip.py
ast-grep outline examples/migrations/codex-to-okf/codex_to_okf.py
ast-grep outline tests/test_codex_okf_example.py

printf '%s\n' '--- source and test references to counts ---'
rg -n -C 5 '16|17|parity|mapped|skipped|resource|message|fixture|golden' \
  examples/migrations/codex-to-okf/validate_portability.py \
  examples/migrations/codex-to-okf/validate_roundtrip.py \
  examples/migrations/codex-to-okf/codex_to_okf.py \
  examples/migrations/codex-to-okf/run.sh \
  examples/migrations/codex-to-okf/run.ps1 \
  tests/test_codex_okf_example.py

printf '%s\n' '--- checked-in report summaries ---'
python3 - <<'PY'
import json
from pathlib import Path

root = Path("examples/migrations/codex-to-okf")
for name in [
    "sample_output/portability-parity.json",
    "sample_output/recall-parity.json",
    "sample_output/okf-bundle/migration-report.json",
]:
    path = root / name
    print(f"\n{name}")
    data = json.loads(path.read_text())
    if isinstance(data, dict):
        for key, value in data.items():
            if isinstance(value, (str, int, float, bool)) or key in {"summary", "counts", "parity"}:
                print(f"{key}: {value!r}")
PY

printf '%s\n' '--- repository state and recent commit subjects ---'
git status --short
git log -8 --oneline -- examples/migrations/codex-to-okf/README.md examples/migrations/codex-to-okf/sample_output/portability-parity.json

Repository: moorcheh-ai/memanto

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
import json
from pathlib import Path

root = Path("examples/migrations/codex-to-okf")
source = root / "sample_data/codex-rollout-sanitized.jsonl"
bundle = root / "sample_output/okf-bundle"
reexport = root / "sample_output/reexported-okf"

def jsonl_message_counts(path):
    records = [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line.strip()]
    visible = []
    for record in records:
        payload = record.get("payload") or {}
        if record.get("type") == "response_item" and payload.get("type") == "message":
            if payload.get("role") in {"user", "assistant"}:
                content = payload.get("content") or []
                text = " ".join(
                    str(item.get("text") or "")
                    for item in content
                    if item.get("type") in {"input_text", "output_text"}
                ).strip()
                if text:
                    visible.append((payload.get("role"), payload.get("id")))
    return len(records), len(visible), visible

def frontmatter_files(path):
    files = sorted(path.glob("memories/*/*.md"))
    parsed = []
    for file in files:
        text = file.read_text(encoding="utf-8")
        if not text.startswith("---\n"):
            continue
        _, metadata, _ = text.split("---\n", 2)
        parsed.append((file.relative_to(path).as_posix(), metadata))
    return files, parsed

records, visible_count, visible = jsonl_message_counts(source)
bundle_files, bundle_docs = frontmatter_files(bundle)
reexport_files, reexport_docs = frontmatter_files(reexport)

print("source_total_records:", records)
print("source_visible_nonempty_messages:", visible_count)
print("source_visible_ids:", [item[1] for item in visible])
print("bundle_memory_files:", len(bundle_docs))
print("reexport_memory_files:", len(reexport_docs))

for report_name in [
    "sample_output/okf-bundle/migration-report.json",
    "sample_output/okf-bundle/migration-report.md",
    "sample_output/portability-parity.json",
    "sample_output/recall-parity.json",
]:
    path = root / report_name
    print(f"\nREPORT {report_name}")
    if path.suffix == ".json":
        data = json.loads(path.read_text(encoding="utf-8"))
        for key in (
            "documents", "golden_questions", "golden_passed",
            "source_memories", "mapped_memories", "reexported_memories",
            "resources_preserved", "types_preserved", "titles_preserved",
            "content_preserved", "passed", "parity_percent",
        ):
            if key in data:
                print(f"{key}: {data[key]!r}")
        summary = data.get("summary")
        if isinstance(summary, dict):
            for key in ("messages_included", "memories_written"):
                if key in summary:
                    print(f"summary.{key}: {summary[key]!r}")
    else:
        for line in path.read_text(encoding="utf-8").splitlines():
            if any(token in line.lower() for token in (
                "messages included", "portable memories", "preserved",
                "mapped", "skipped", "16", "17",
            )):
                print(line)
PY

printf '%s\n' '--- exact README and renderer artifact lines ---'
sed -n '132,155p' examples/migrations/codex-to-okf/README.md
sed -n '330,360p' examples/migrations/codex-to-okf/make_demo_video.py
printf '%s\n' '--- tracked artifact metadata ---'
stat -c '%n %s bytes' examples/migrations/codex-to-okf/demo.m4v

Repository: moorcheh-ai/memanto

Length of output: 2949


Align the fixture, reports, and README with the 17-memory objective.

The checked-in rollout produces 16 portable memories. The bundle and reports record 16/16 parity and 16 mapped records. If 17 is the acceptance target, add the missing source memory and regenerate the bundle, reports, demo, and README together. Preserve the historical imported message that mentions 16.

The demo command writes codex-okf-demo.mp4, but the README links to demo.m4v. Use one filename and extension consistently.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/migrations/codex-to-okf/README.md` around lines 74 - 83, Align the
codex-to-okf migration fixture, generated bundle, reports, demo output, and
README with the 17-memory acceptance target by adding the missing source memory
and regenerating all artifacts; preserve the historical imported message
mentioning 16. Also update the demo command and README reference to use the same
filename and extension instead of mixing codex-okf-demo.mp4 and demo.m4v.

Comment thread examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/overview.md Outdated
@Yutre3

Yutre3 commented Aug 10, 2026

Copy link
Copy Markdown
Author

Review follow-up complete through commit 2732767:

  • Addressed the initial 14 findings and the 4-item second pass.
  • Local targeted suite: 4 passed; Ruff lint and format checks passed.
  • Official loader → mapper → exporter parity: 15/15; golden recall: 4/4.
  • Broad, unscoped consent is deliberately excluded from durable memory.
  • Replacement revalidates the renamed filesystem object before deletion; normalized output contains no wall-clock footer.
  • Live Moorcheh retrieval returned the $200 goal with exact generated-file attribution.
  • Corrected public 80-second demo on X: https://x.com/nobrenobre86479/status/2086955536763740248

The X post tags @moorcheh_ai and links back to this PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-009-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md`:
- Line 5: Regenerate the checked-in OKF bundle from the current fixture so its
resource identifiers use the fixture’s current hash 6b292468f6e8edc9 instead of
the stale synthetic session hash. Update the corresponding migration-report.json
and all related parity artifacts together, including the resource field in the
bundle output.

In `@examples/migrations/codex-to-okf/sample_output/portability-parity.json`:
- Around line 11-19: Reconcile the parity artifact with the migration contract
by determining whether the expected memory count is 15 or 16. If 16 is required,
add the missing memory and corresponding type, then regenerate the parity JSON
and all related bundle, index, metrics, and claims artifacts; otherwise update
the 16-memory claims to 15. Do not modify imported prose solely to manufacture
parity.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be3750dc-1fd5-48ae-9fe6-d15972fa4dbc

📥 Commits

Reviewing files that changed from the base of the PR and between 98455eb and 2732767.

⛔ Files ignored due to path filters (1)
  • examples/migrations/codex-to-okf/demo.m4v is excluded by !**/*.m4v
📒 Files selected for processing (33)
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/codex_to_okf.py
  • examples/migrations/codex-to-okf/make_demo_video.py
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-012-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-015-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-006-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-008-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-009-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-010-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-005-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-007-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-011-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-013-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-014-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/recall-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/index.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/overview.md
  • examples/migrations/codex-to-okf/validate_portability.py
  • tests/test_codex_okf_example.py
🚧 Files skipped from review as they are similar to previous changes (18)
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/index.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/recall-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/validate_portability.py
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • tests/test_codex_okf_example.py
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/codex_to_okf.py

Comment on lines +11 to +19
"source_memories": 15,
"mapped_memories": 15,
"reexported_memories": 15,
"resources_preserved": 15,
"types_preserved": 15,
"titles_preserved": 15,
"content_preserved": 15,
"passed": 15,
"parity_percent": 100.0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Reconcile the 15-memory parity artifact with the 16-memory migration contract.

This file reports 15 source, mapped, re-exported, and passed memories. The per-type counts also sum to 15. The PR objective and examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-015-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md claim 16/16, while examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/index.md and examples/migrations/codex-to-okf/sample_output/reexported-okf/metrics/overview.md report 15. If 16 is required, add the missing memory and type, then regenerate all evidence. If 15 is correct, update the claims to 15. Do not edit imported prose only to force parity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/migrations/codex-to-okf/sample_output/portability-parity.json`
around lines 11 - 19, Reconcile the parity artifact with the migration contract
by determining whether the expected memory count is 15 or 16. If 16 is required,
add the missing memory and corresponding type, then regenerate the parity JSON
and all related bundle, index, metrics, and claims artifacts; otherwise update
the 16-memory claims to 15. Do not modify imported prose solely to manufacture
parity.

@Yutre3

Yutre3 commented Aug 10, 2026

Copy link
Copy Markdown
Author

Third review follow-up in commit bde1415:

  • Canonicalized the checked-in JSONL fixture to LF via .gitattributes, regenerated every source-derived URN/report, and added a regression test that proves the report SHA-256 and session-<digest> provenance match the repository bytes.
  • Kept the historical source sentence mentioning 16/16 verbatim, but documented explicitly that it is earlier-run input rather than current evidence. The current authoritative reports remain 15/15 because unscoped consent is excluded.
  • Re-rendered the demo from the corrected evidence.

Validation: 5 passed, Ruff lint/format passed, official loader → mapper → exporter 15/15, Memanto dry-run 15 mapped / 0 skipped.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_codex_okf_example.py`:
- Around line 220-223: Update the memory-file assertion in the test around
memory_files to materialize the rglob result, assert that at least one memory
file exists, then verify every file contains expected_session.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 23de5870-d0cb-43c3-a97b-240d44ec77f2

📥 Commits

Reviewing files that changed from the base of the PR and between 2732767 and bde1415.

⛔ Files ignored due to path filters (1)
  • examples/migrations/codex-to-okf/demo.m4v is excluded by !**/*.m4v
📒 Files selected for processing (26)
  • .gitattributes
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-012-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-015-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-006-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-008-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-009-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-010-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-005-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-007-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-011-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-013-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-014-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md
  • tests/test_codex_okf_example.py
🚧 Files skipped from review as they are similar to previous changes (24)
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172839-005-voy-a-tratarlo-como-una-misi-n-real-no-como-una-lluvia-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174123-011-el-cat-logo-de-opire-s-tiene-volumen-pero-sus-recompensa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-003-tu-objetivo-es-ganar-200-como-minimo.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173936-010-ahora-s-apareci-una-se-al-fuerte-opire-muestra-327-recom.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810173342-008-la-primera-plataforma-que-parec-a-prometer-usd-500-no-pa.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/decision/20260810172852-006-primero-estoy-comparando-recompensas-abiertas-con-pago-d.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810173707-009-el-escaneo-general-confirm-que-algora-est-pr-cticamente-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810174350-012-la-depuraci-n-ya-dej-fuera-casi-todo-opire-varias-recomp.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/artifact/20260810180411-015-la-ruta-t-cnica-ya-pas-tres-controles-16-memorias-okf-im.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810172953-007-encontr-dos-recompensas-financiadas-de-usd-500-con-pago-.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/goal/20260810172828-001-generame-200-dolares-y-haz-algo-en-lo-que-realmente-seas.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/artifact/artifact.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-004-no-puedes-usar-mis-redes-sociales-en-cualquier-caso-si-n.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/goal/goal.md
  • examples/migrations/codex-to-okf/sample_output/portability-parity.json
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810174552-013-el-bounty-de-azerothcore-tambi-n-fue-cerrado-por-los-man.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/observation/20260810175103-014-la-candidatura-ya-tiene-un-adaptador-funcional-dise-ado-.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/instruction/instruction.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/memories/instruction/20260810172828-002-no-acepto-un-no-puedo-generar-dinero-por-ti-como-respues.md
  • examples/migrations/codex-to-okf/README.md
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/decision/decision.md
  • examples/migrations/codex-to-okf/sample_output/okf-bundle/migration-report.json
  • examples/migrations/codex-to-okf/sample_output/reexported-okf/memories/observation/observation.md

Comment thread tests/test_codex_okf_example.py Outdated
@Yutre3

Yutre3 commented Aug 11, 2026

Copy link
Copy Markdown
Author

Final review follow-up in commit 4d7adbc: materialized the memory-file list and asserted it is non-empty before checking every provenance URN. Validation remains 5 passed; Ruff lint/format pass.

@Yutre3

Yutre3 commented Aug 11, 2026

Copy link
Copy Markdown
Author

Live retrieval proof is now public: https://x.com/nobrenobre86479/status/2086975140928127092. Moorcheh retrieved the exact $200 goal from the imported Codex OKF memory and cited the source file. The pinned video thread now also includes the privacy audit and 15/15 portability breakdown.

@Yutre3

Yutre3 commented Aug 11, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Yutre3

Yutre3 commented Aug 11, 2026

Copy link
Copy Markdown
Author

Enhanced end-to-end video: https://x.com/nobrenobre86479/status/2087054784419262642. It now shows the reproducible Codex → OKF → Memanto pipeline and finishes with the live Moorcheh response retrieving the exact $200 goal with source-file attribution.

@Yutre3

Yutre3 commented Aug 11, 2026

Copy link
Copy Markdown
Author

@mjfekri The submission is ready for human review: all checks pass, all CodeRabbit findings are addressed, and the reproducible gates report 5 tests passed, 15/15 OKF round-trip, 4/4 recall, plus live Moorcheh source attribution. The final PR also includes corrected demos and an explicit AI-assistance disclosure. When convenient, could you or another maintainer review it for #1609? I will respond promptly to any requested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bounty#6 Migration, OKF

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant