Skip to content

feat(helioslite): safely import verified Forge session snapshots - #147

Merged
KooshaPari merged 4 commits into
mainfrom
integrate/helioslite-importer-20260808
Aug 8, 2026
Merged

feat(helioslite): safely import verified Forge session snapshots#147
KooshaPari merged 4 commits into
mainfrom
integrate/helioslite-importer-20260808

Conversation

@KooshaPari

Copy link
Copy Markdown
Owner

Summary

Integrates the four reviewed HeliosLite session-import commits on current main:

  1. isolates HeliosLite config/runtime paths from Forge;
  2. adds read-only, validated Forge snapshot export and idempotent publication;
  3. adds HeliosLite-only sessions import-forge CLI dispatch and containment checks;
  4. rejects symlinked or overlapping sessions roots.

Safety invariants

  • Source SQLite sidecars (-wal, -shm, -journal) fail closed.
  • Destination traversal, symlink escapes, and overlap with ~/.forge are rejected.
  • Existing bundles are accepted only when provenance and content digests validate identically.

Local evidence

  • cargo test -q -p forge_repo conversation::snapshot::tests -> 4 passed
  • cargo test -q -p forge_main --lib ui::tests -> 6 passed
  • git diff --check -> passed

No package, tag, release, or merge is included in this PR.

@mergify mergify Bot added rust labels Aug 8, 2026
@socket-security

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@KooshaPari
KooshaPari marked this pull request as ready for review August 8, 2026 23:46
Copilot AI lite review requested due to automatic review settings August 8, 2026 23:46
@KooshaPari
KooshaPari merged commit 4fc4ebb into main Aug 8, 2026
25 of 34 checks passed
@KooshaPari
KooshaPari deleted the integrate/helioslite-importer-20260808 branch August 8, 2026 23:46

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: 2371e4038d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"context",
"context_zstd",
"is_compressed",
"hidden",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop requiring the nonexistent hidden column

The current Forge conversations schema in crates/forge_repo/src/database/schema.rs and the migrations have no hidden column, but export_forge_snapshot requires it during validate_schema before reading any rows. As a result, importing a normal Forge database created by this repo fails with missing columns: hidden, making helioslite sessions import-forge unusable unless the DB came from the test-only fixture. Drop this requirement/query or add a migration before gating imports on it.

Useful? React with 👍 / 👎.

Comment on lines +184 to +188
if destination.exists() {
return Err(anyhow::anyhow!(
"snapshot destination already exists: {}",
destination.display()
));

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 Let existing verified snapshots reach publication

This preflight rejects every existing destination, but publish_snapshot_atomic is explicitly written to verify a matching existing bundle and no-op. When a user reruns helioslite sessions import-forge --dest <same dir> after a successful import, validation fails here before provenance/content checks run, so the idempotent import path advertised by the snapshot publisher is unreachable.

Useful? React with 👍 / 👎.

Comment on lines +174 to +176
if candidate == forge_root
|| candidate.starts_with(&forge_root)
|| forge_root.starts_with(candidate)

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 Normalize HELIOSLITE_HOME before overlap checks

The overlap guard compares candidate exactly as provided against an absolute home.join(".forge"). If HeliosLite is launched from $HOME with HELIOSLITE_HOME=.forge (or through a symlink to ~/.forge), this check does not fire and HeliosLite uses the standard Forge root for its database, credentials, and other runtime files, defeating the isolation this change is trying to enforce. Resolve relative paths and symlinks before comparing with the Forge root.

Useful? React with 👍 / 👎.

);
Ok(())
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: File is 760 lines, exceeding the 500-line hard limit

The review policy requires files to be ≤500 lines. This new module should be decomposed into smaller, focused units (e.g., separate schema validation, publishing, and fingerprinting modules).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 New Issue + 3 Existing Issues | Recommendation: Address before merge (PR already merged)

Overview

Severity Count
CRITICAL 1 (existing)
WARNING 3 (2 existing + 1 new)
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
crates/forge_repo/src/conversation/snapshot.rs 32 Requires nonexistent hidden column, making importer unusable with real Forge databases

WARNING

File Line Issue
crates/forge_main/src/ui.rs 188 Preflight rejects existing destinations, making idempotent publish_snapshot_atomic unreachable from CLI
crates/forge_config/src/reader.rs 176 HELIOSLITE_HOME not normalized before overlap checks with ~/.forge
crates/forge_repo/src/conversation/snapshot.rs 760 File is 760 lines, exceeding the 500-line hard limit
Files Reviewed (4 files)
  • crates/forge_repo/src/conversation/snapshot.rs - 2 issues (1 existing CRITICAL + 1 new WARNING)
  • crates/forge_main/src/ui.rs - 1 existing WARNING
  • crates/forge_config/src/reader.rs - 1 existing WARNING
  • crates/forge_main/src/cli.rs - no new issues

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 112.6K · Output: 26.4K · Cached: 1.5M

KooshaPari added a commit that referenced this pull request Aug 9, 2026
…shot import)

Resolved forge_config/reader.rs conflict by keeping the remote binary-aware resolution (HELIOSLITE_HOME with overlap validation, config_dir/sessions_path) while restoring Gate 5 legacy ~/.forge precedence for the helioslite binary and the public binary_prefix() used by the updater and heliosdoctor. cli.rs/ui.rs auto-merged; workspace check and forge_config tests (52) pass.
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.

2 participants