Skip to content

[limen jules LIMEN-067] feat: context sync diff/changelog between runs#136

Open
4444J99 wants to merge 2 commits into
mainfrom
limen/jules-limen-067-1688
Open

[limen jules LIMEN-067] feat: context sync diff/changelog between runs#136
4444J99 wants to merge 2 commits into
mainfrom
limen/jules-limen-067-1688

Conversation

@4444J99

@4444J99 4444J99 commented Jun 19, 2026

Copy link
Copy Markdown
Member

Lands completed jules session 8747587654007889078.

limen task LIMEN-067

limen task LIMEN-067 (jules session 8747587654007889078)
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Spec Compliance Report

Traceability Audit

  • Headers found: 33
  • Specs covered: 27/27 (100%)
  • Errors: 0
  • Warnings: 22

Invariant Validators

  • INV-000-001:dag
  • INV-000-002:reachability
  • INV-000-005:observability

Ruff Lint

✅ Exit code: 0

Tests & Coverage

✅ Tests exit code: 0

  • Coverage: 73%

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48a6194764

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

from organvm_engine.contextmd import AUTO_START, AUTO_END
import re

changelog_file = context_changelog_path()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor --workspace for changelog lookup

When context --workspace /tmp/ws sync --write records history, sync_all writes the changelog via a PathConfig(workspace_dir=workspace), but this lookup ignores args.workspace and reads the default corpus instead. In multi-workspace or test runs, rollback can report no records or apply a timestamp from the default workspace to unrelated files; cmd_context_diff has the same lookup issue above.

Useful? React with 👍 / 👎.

for change in changes:
record = {
"timestamp": sync_timestamp,
"path": change["path"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Persist resolved paths in changelog entries

When sync is invoked with a relative workspace, for example organvm context --workspace . sync --write, change["path"] is relative because ws is not resolved before generating changes. Persisting that value makes rollback later interpret it relative to the rollback process's current directory, so running rollback from another directory can edit/delete the wrong context file or skip the original one.

Useful? React with 👍 / 👎.

import time
from organvm_engine.paths import PathConfig, context_changelog_path

sync_timestamp = int(time.time())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a unique run id for sync records

When two syncs run within the same second, such as in automation or a script calling sync_all twice, both batches receive the same timestamp. Since context diff groups by timestamp and context rollback selects every record with the requested timestamp, a rollback intended for one run will also roll back the other run's files; use a per-run UUID or a higher-resolution timestamp.

Useful? React with 👍 / 👎.

elif action == "updated":
if AUTO_START in content and AUTO_END in content:
pattern = re.escape(AUTO_START) + r".*" + re.escape(AUTO_END)
new_content = re.sub(pattern, old_section, content, flags=re.DOTALL)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard rollback against newer syncs

When a file has been synced again after the selected timestamp, rollback still replaces the current AUTO block with this record's old_section without checking that the current block matches the record's new_section. That makes rolling back an older changelog entry silently discard later context updates; compare the current block/after hash first and skip or warn on mismatch.

Useful? React with 👍 / 👎.

Comment on lines +193 to +194
config = PathConfig(workspace_dir=workspace) if workspace else None
changelog_file = context_changelog_path(config)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep changelogs with overridden registries

When context sync is run with a top-level --registry pointing at an alternate corpus or fixture, the generated files are based on that registry but the persistent changelog is still resolved only from workspace/environment defaults here. That sends history for the alternate registry to the default corpus path, so the matching context diff/rollback run cannot find it and the default corpus can accumulate unrelated rollback records.

Useful? React with 👍 / 👎.

- Fix W293 (blank line whitespace), I001 (import sorting), PTH123
  (Path.open()), F401 (unused import), F541 (f-string), F841 (unused var)
- Fix duplicate --format argument on registry list subparser causing
  argparse.ArgumentError and CI test failure
- All lint, typecheck, and CLI tests now passing
4444J99 added a commit that referenced this pull request Jul 6, 2026
limen task HEAL-cifix-organvm-organvm-engine-136

Co-authored-by: 4444J99 <4444J99@users.noreply.github.com>
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