Skip to content

Add history compaction command and TOON workaround tracking - #122

Merged
unbraind merged 4 commits into
mainfrom
feat/history-compact-toon-tracking-coverage
Jun 6, 2026
Merged

unbraind merged 4 commits into
mainfrom
feat/history-compact-toon-tracking-coverage

Conversation

@unbraind

@unbraind unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • implement pm history-compact <id> with boundary parsing (--before version/timestamp), synthetic checkpoint baseline generation, retained-tail hash re-anchoring, integrity verification, rollback-safe atomic writes, and audit marker creation
  • wire the new command through CLI registration, MCP routing, help text, shell completions, and SDK contracts (including regenerated full contract fixtures)
  • harden TOON bracket-workaround traceability by adding explicit upstream tracking metadata in toon-decode plus guard tests, and record end-to-end evidence on pm-3pbq + pm-idnz
  • maintain strict verification posture with updated runtime assertions and full local gate/manual packed-install smoke evidence

Test plan

  • pnpm build
  • pnpm typecheck
  • node scripts/run-tests.mjs coverage
  • pnpm contracts:check
  • pnpm changelog:pm:check
  • pnpm security:scan
  • pm validate --check-resolution --check-history-drift
  • pm health --check-only
  • node scripts/run-tests.mjs test -- tests/unit/toon-decode.spec.ts
  • manual packed-install smoke in temp dir: npm pack -> install tarball -> pm init -> create/update/history/history-compact(dry+apply)/restore/history --verify

This consolidates pm-3pbq and pm-idnz by adding the history-compact command surface, wiring it across runtime/contracts/docs/completions, and hardening decoder workaround traceability with guard tests while preserving strict verification evidence in linked pm items.

@sourcery-ai sourcery-ai 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.

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unbraind, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 6 minutes and 48 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 48707e03-1653-4ed2-86ef-b0e9d1148ff8

📥 Commits

Reviewing files that changed from the base of the PR and between c3ab333 and 1901a14.

📒 Files selected for processing (8)
  • .agents/pm/chores/pm-idnz.toon
  • .agents/pm/features/pm-3pbq.toon
  • .agents/pm/history/pm-3pbq.jsonl
  • .agents/pm/history/pm-idnz.jsonl
  • CHANGELOG.md
  • src/cli/commands/history-compact.ts
  • tests/integration/history-compact-command.spec.ts
  • vitest.config.ts
📝 Walkthrough

Walkthrough

This PR introduces a new history-compact command that rewrites item history streams by creating a baseline checkpoint and retaining newer entries with re-anchored hash references. The feature integrates across CLI, SDK, MCP, shell completions, and documentation. It also adds upstream tracking metadata for a TOON scalar-bracket escape workaround.

Changes

History Compaction and Related Tracking

Layer / File(s) Summary
Core compaction algorithm and types
src/cli/commands/history-compact.ts
HistoryCompactCommandOptions and HistoryCompactResult types; parseBeforeBoundary parses --before as version/timestamp; replayHistoryAndResolveCheckpoint validates hash chain and captures checkpoint at boundary; reanchorRetainedEntries rewrites retained entries' hashes; runHistoryCompact orchestrates the full flow with ownership checks, lock acquisition, atomic file writes, and rollback.
CLI command registration and documentation
src/cli/register-mutation.ts, src/cli/commands/index.ts, src/cli/help-content.ts, docs/COMMANDS.md
Registers pm history-compact <id> with --before, --dry-run, --author, --message, --force options; adds help text and usage examples; exports the command module.
SDK/CLI contract surface definitions
src/sdk/cli-contracts.ts, src/sdk/cli-contracts/enum-contracts.ts, src/sdk/cli-contracts/tool-parameter-tables.ts
Defines history-compact in PM_CORE_COMMAND_NAMES and PM_TOOL_ACTIONS enums; exports HISTORY_COMPACT_FLAG_CONTRACTS array; adds before parameter type and metadata; extends tool-action schema to require id and allow before/dryRun/force.
Shell completion generation
src/cli/commands/completion.ts
Adds history-compact subcommand and flag completions across bash, zsh, and fish shells, including --before, --dry-run, --author, --message, --force.
Contract fixtures and MCP integration
tests/fixtures/contracts/full.json, src/mcp/server.ts
Updates action availability, command flags, and parameter schema fixtures; integrates history-compact as a native MCP action with updated initialization instructions.
TOON bracket-escape workaround tracking
src/core/item/toon-decode.ts
Exports TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR and TOON_SCALAR_BRACKET_ESCAPE_TRACKING constants documenting the upstream fix watch status and removal conditions.
Comprehensive command behavior tests
tests/unit/history-compact-command.spec.ts
Tests default compaction, prefix compaction with --before boundary, dryRun preview-only mode, no-op when --before is first version, and rejection on invalid history chain.
Integration tests and coverage
tests/integration/release-readiness-runtime.spec.ts, tests/unit/completion-command.spec.ts, tests/unit/contracts-command.spec.ts, vitest.config.ts
Validates help output and required flags; softens coverage-gate assertions to ensure history-compact.ts is fully covered; updates completion and contract parity tests.
Agent planning and workflow tracking
.agents/pm/chores/pm-idnz.toon, .agents/pm/features/pm-3pbq.toon, .agents/pm/history/*.jsonl
Updates feature/chore metadata to in_progress status; records workflow history documenting upstream PR watch, implementation details, coverage campaigns, and manual verification.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • unbraind/pm-cli#74: Introduces checkHistoryRewriteOwnership and verifyHistoryRewriteNoDrift helpers from src/core/history/history-rewrite.ts that are directly used by the history-compact command implementation.
  • unbraind/pm-cli#76: Modifies shared shell-completion rendering in src/cli/commands/completion.ts and completion-command.spec.ts, which overlaps with this PR's completion support additions.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% 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
Title check ✅ Passed The title clearly summarizes the main changes: a new history-compact command and TOON workaround tracking enhancements.
Description check ✅ Passed The description is comprehensive and directly addresses the changeset, detailing implementation, integration, hardening measures, and a thorough test plan.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements the history-compact command, enabling checkpoint-based history stream compaction into a synthetic baseline and a retained tail. The implementation spans CLI command registration, help documentation, shell completions, MCP server routing, contract definitions, and comprehensive unit and integration tests. Additionally, it introduces explicit upstream tracking metadata and guard tests for the TOON scalar-bracket workaround in toon-decode.ts. No review comments were provided for this pull request.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the history-compact command to compact long history streams into a synthetic baseline and a retained tail, along with adding explicit upstream tracking metadata and tests for the TOON scalar bracket workaround. Feedback on the changes suggests improving the timestamp boundary parsing in history-compact to break the loop upon encountering the first entry at or after the boundary, preventing correctness issues with out-of-order timestamps.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +119 to +131
let compactCount = 0;
for (const [index, entry] of entries.entries()) {
const entryTs = Date.parse(entry.ts);
if (!Number.isFinite(entryTs)) {
throw new PmCliError(
`History for this item contains invalid timestamp at entry ${index + 1}.`,
EXIT_CODE.GENERIC_FAILURE,
);
}
if (entryTs < beforeTs) {
compactCount += 1;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

When parsing the --before timestamp boundary, simply counting the entries that have a timestamp less than beforeTs can lead to correctness issues if the history stream contains any out-of-order timestamps (e.g., due to clock skew or rapid sequential writes). Since compaction must prune a contiguous prefix of the history, we should instead find the first entry that is at or after the boundary timestamp and stop there. This ensures we only compact entries that are strictly before the boundary.

Suggested change
let compactCount = 0;
for (const [index, entry] of entries.entries()) {
const entryTs = Date.parse(entry.ts);
if (!Number.isFinite(entryTs)) {
throw new PmCliError(
`History for this item contains invalid timestamp at entry ${index + 1}.`,
EXIT_CODE.GENERIC_FAILURE,
);
}
if (entryTs < beforeTs) {
compactCount += 1;
}
}
let compactCount = 0;
for (const [index, entry] of entries.entries()) {
const entryTs = Date.parse(entry.ts);
if (!Number.isFinite(entryTs)) {
throw new PmCliError(
`History for this item contains invalid timestamp at entry ${index + 1}.`,
EXIT_CODE.GENERIC_FAILURE,
);
}
if (entryTs >= beforeTs) {
break;
}
compactCount += 1;
}

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the pm history-compact command, which enables checkpoint-based history stream compaction by replaying mutations to a synthetic baseline and re-anchoring the hash chain. It also adds explicit upstream tracking metadata for the TOON scalar bracket workaround. The review feedback highlights two key issues: a potential history corruption risk when compacting by timestamp if the stream contains non-monotonic timestamps, and inaccurate entry numbers reported in error messages during re-anchoring due to a missing index offset.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +119 to +131
let compactCount = 0;
for (const [index, entry] of entries.entries()) {
const entryTs = Date.parse(entry.ts);
if (!Number.isFinite(entryTs)) {
throw new PmCliError(
`History for this item contains invalid timestamp at entry ${index + 1}.`,
EXIT_CODE.GENERIC_FAILURE,
);
}
if (entryTs < beforeTs) {
compactCount += 1;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Using a simple counter to determine compactCount based on timestamps can lead to severe history corruption or data loss if the history stream contains non-monotonic timestamps (e.g., due to clock drift or manual edits). Instead of counting all matching entries, we should find the contiguous prefix boundary by breaking the loop at the first entry that is equal to or newer than the target timestamp.

Suggested change
let compactCount = 0;
for (const [index, entry] of entries.entries()) {
const entryTs = Date.parse(entry.ts);
if (!Number.isFinite(entryTs)) {
throw new PmCliError(
`History for this item contains invalid timestamp at entry ${index + 1}.`,
EXIT_CODE.GENERIC_FAILURE,
);
}
if (entryTs < beforeTs) {
compactCount += 1;
}
}
let compactCount = 0;
for (const [index, entry] of entries.entries()) {
const entryTs = Date.parse(entry.ts);
if (!Number.isFinite(entryTs)) {
throw new PmCliError(
`History for this item contains invalid timestamp at entry ${index + 1}.`,
EXIT_CODE.GENERIC_FAILURE,
);
}
if (entryTs >= beforeTs) {
break;
}
compactCount += 1;
}

Comment on lines +188 to +210
function reanchorRetainedEntries(
retainedEntries: HistoryEntry[],
seed: ReplayDocument,
): {
entries: HistoryEntry[];
finalReplay: ReplayDocument;
} {
let replay = structuredClone(seed);
const rewritten: HistoryEntry[] = [];
for (const [index, entry] of retainedEntries.entries()) {
const beforeHash = replayHash(replay);
replay = applyHistoryPatch(replay, entry, index + 1);
rewritten.push({
...entry,
before_hash: beforeHash,
after_hash: replayHash(replay),
});
}
return {
entries: rewritten,
finalReplay: replay,
};
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The reanchorRetainedEntries function currently reports incorrect/misleading entry numbers in its error messages because it uses the 1-based index of the sliced retainedEntries array rather than the original entry numbers from the full history stream. To fix this, pass the original offset (boundary.compactCount) to reanchorRetainedEntries so that the reported entry numbers are accurate.

function reanchorRetainedEntries(
  retainedEntries: HistoryEntry[],
  seed: ReplayDocument,
  offset: number,
): {
  entries: HistoryEntry[];
  finalReplay: ReplayDocument;
} {
  let replay = structuredClone(seed);
  const rewritten: HistoryEntry[] = [];
  for (const [index, entry] of retainedEntries.entries()) {
    const beforeHash = replayHash(replay);
    replay = applyHistoryPatch(replay, entry, offset + index + 1);
    rewritten.push({
      ...entry,
      before_hash: beforeHash,
      after_hash: replayHash(replay),
    });
  }
  return {
    entries: rewritten,
    finalReplay: replay,
  };
}

Comment thread src/cli/commands/history-compact.ts Outdated
if (changed) {
const { checkpoint, finalReplay } = replayHistoryAndResolveCheckpoint(historyEntries, boundary.compactCount);
const retained = historyEntries.slice(boundary.compactCount);
const reanchored = reanchorRetainedEntries(retained, checkpoint);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Pass the offset (boundary.compactCount) to reanchorRetainedEntries to ensure accurate entry numbers are reported in error messages.

Suggested change
const reanchored = reanchorRetainedEntries(retained, checkpoint);
const reanchored = reanchorRetainedEntries(retained, checkpoint, boundary.compactCount);

@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

🧹 Nitpick comments (1)
tests/unit/history-compact-command.spec.ts (1)

69-147: ⚡ Quick win

Add an explicit ISO timestamp boundary test for --before.

The suite validates default/version/noop paths but not the timestamp parsing branch, so regressions there could slip through.

Suggested test addition
+  it("compacts entries strictly before an ISO timestamp boundary", async () => {
+    await withTempPmPath(async (context) => {
+      const id = createItem(context, "Compact Timestamp Boundary");
+      expect(context.runCli(["update", id, "--status", "in_progress"]).code).toBe(0);
+      expect(context.runCli(["append", id, "--body", "tail entry"]).code).toBe(0);
+
+      const full = await runHistory(id, { full: true }, { path: context.pmPath });
+      const boundaryTs = full.history[2]?.ts;
+      expect(typeof boundaryTs).toBe("string");
+
+      const compacted = await runHistoryCompact(
+        id,
+        { before: boundaryTs as string, author: "test-author" },
+        { path: context.pmPath },
+      );
+
+      expect(compacted.compact_boundary.kind).toBe("timestamp");
+      expect(compacted.changed).toBe(true);
+      expect(compacted.compact_boundary.entries_compacted).toBeGreaterThan(0);
+      expect(compacted.history.verify_ok).toBe(true);
+    });
+  });
🤖 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 `@tests/unit/history-compact-command.spec.ts` around lines 69 - 147, Add a new
unit test that exercises the timestamp parsing branch of runHistoryCompact by
creating an item (createItem), adding at least two subsequent history entries
(e.g., update/append), then call runHistory(full: true) to read the entries'
created_at timestamps and choose an ISO timestamp between entries as the
--before value; invoke runHistoryCompact(id, { before: "<ISO-timestamp>",
author: "test-author" }, { path: context.pmPath }) and assert the result reports
compact_boundary.kind === "timestamp", correct
entries_compacted/entries_retained/first_retained_entry values, changed===true
(or unchanged for a noop case), and that history verification and history file
state match the other tests' expectations (use existing helpers: withTempPmPath,
runHistoryCompact, runHistory, getHistoryPath, readFile). Ensure the test name
clearly states it validates ISO timestamp boundary parsing.
🤖 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 `@vitest.config.ts`:
- Line 177: Remove the duplicate coverage exclusion for the CLI history-compact
command: in vitest.config.ts locate the coverage.include and coverage.exclude
arrays and delete the string "src/cli/commands/history-compact.ts" from the
coverage.exclude array so the include entry remains effective; ensure no other
duplicate entries remain in coverage.exclude that also appear in
coverage.include.

---

Nitpick comments:
In `@tests/unit/history-compact-command.spec.ts`:
- Around line 69-147: Add a new unit test that exercises the timestamp parsing
branch of runHistoryCompact by creating an item (createItem), adding at least
two subsequent history entries (e.g., update/append), then call runHistory(full:
true) to read the entries' created_at timestamps and choose an ISO timestamp
between entries as the --before value; invoke runHistoryCompact(id, { before:
"<ISO-timestamp>", author: "test-author" }, { path: context.pmPath }) and assert
the result reports compact_boundary.kind === "timestamp", correct
entries_compacted/entries_retained/first_retained_entry values, changed===true
(or unchanged for a noop case), and that history verification and history file
state match the other tests' expectations (use existing helpers: withTempPmPath,
runHistoryCompact, runHistory, getHistoryPath, readFile). Ensure the test name
clearly states it validates ISO timestamp boundary parsing.
🪄 Autofix (Beta)

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: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: e55fd1a1-870a-4543-b976-079dc51409cc

📥 Commits

Reviewing files that changed from the base of the PR and between cacb554 and c3ab333.

📒 Files selected for processing (23)
  • .agents/pm/chores/pm-idnz.toon
  • .agents/pm/features/pm-3pbq.toon
  • .agents/pm/history/pm-3pbq.jsonl
  • .agents/pm/history/pm-idnz.jsonl
  • docs/COMMANDS.md
  • src/cli/commands/completion.ts
  • src/cli/commands/contracts.ts
  • src/cli/commands/history-compact.ts
  • src/cli/commands/index.ts
  • src/cli/help-content.ts
  • src/cli/register-mutation.ts
  • src/core/item/toon-decode.ts
  • src/mcp/server.ts
  • src/sdk/cli-contracts.ts
  • src/sdk/cli-contracts/enum-contracts.ts
  • src/sdk/cli-contracts/tool-parameter-tables.ts
  • tests/fixtures/contracts/full.json
  • tests/integration/release-readiness-runtime.spec.ts
  • tests/unit/completion-command.spec.ts
  • tests/unit/contracts-command.spec.ts
  • tests/unit/history-compact-command.spec.ts
  • tests/unit/toon-decode.spec.ts
  • vitest.config.ts

Comment thread vitest.config.ts Resolved
This addresses PR review findings by enforcing contiguous timestamp compaction semantics and accurate retained-tail entry indexing, then expands integration coverage to exercise defensive/error branches while keeping static quality gates green.
@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the history-compact command, enabling checkpoint-based history stream compaction into a synthetic baseline and a retained tail. The implementation includes the core command logic, CLI registration, shell completions, MCP routing, contract definitions, documentation, and extensive test coverage. It also adds explicit upstream tracking metadata and tests for the TOON scalar bracket workaround. No review comments were provided, so I have no feedback to offer.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

This records final acceptance evidence by marking pm-3pbq and pm-idnz closed and released after green checks, review-loop fixes, and full verification gates.
@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements the history-compact command, which compacts long history streams into a synthetic baseline plus a retained tail while preserving replay integrity. The changes include the core command implementation, CLI registration, help content, shell completions, MCP server routing, and contract schema updates. Additionally, explicit upstream tracking metadata and tests have been added for the @toon-format/toon bracket-bug workaround. Comprehensive unit and integration tests are introduced to verify the compaction behavior, boundary conditions, and rollback safety. There are no review comments to address, and no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements the history-compact command, allowing users to compact long-lived item history streams into a synthetic baseline entry and a retained tail while preserving replay integrity. The command is fully integrated across the CLI, shell completions, MCP routing, and contract schemas, and is backed by comprehensive integration tests. Additionally, the PR adds explicit upstream tracking metadata and tests for the @toon-format/toon scalar bracket workaround. No review comments were provided for this pull request, so there is no feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

This refreshes CHANGELOG.md after closing and releasing pm-3pbq and pm-idnz so static release gates remain in sync with tracker state.
@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the history-compact command, which compacts long history streams into a synthetic checkpoint baseline and a retained tail while preserving replay integrity. The command is fully integrated into the CLI registration, shell completions, MCP routing, and contracts. Additionally, explicit upstream tracking metadata and tests have been added for the TOON scalar bracket workaround in toon-decode.ts. Comprehensive unit and integration tests have been added to verify the compaction behavior and ensure 100% test coverage. No review comments were provided, so there is no additional feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements the pm history-compact command to support checkpoint-based history stream compaction, allowing long mutation streams to be compacted into a synthetic baseline with a retained tail. Additionally, it introduces explicit upstream tracking metadata for the TOON bracket-bug workaround in toon-decode.ts and updates the CLI registration, completions, contracts, documentation, and test suites accordingly. As there are no review comments provided for this pull request, I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the pm history-compact command, which compacts long history streams into a synthetic baseline checkpoint plus a retained tail, preserving replay integrity. The implementation includes CLI registration, help documentation, shell completion support, MCP routing, contract definitions, and extensive integration and unit tests. Additionally, explicit upstream tracking metadata and tests have been added for the TOON scalar bracket workaround. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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