Skip to content

Package the CLI as mft-config - #5

Draft
oveddan wants to merge 2 commits into
mainfrom
agent/mft-config-cli
Draft

Package the CLI as mft-config#5
oveddan wants to merge 2 commits into
mainfrom
agent/mft-config-cli

Conversation

@oveddan

@oveddan oveddan commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • ship mft-config as the primary installed executable while retaining mft-export as a deprecated compatibility alias
  • add clean prepare/prepack builds, a minimal package allowlist, and repository/engine/license metadata
  • smoke-test the packed tarball from a clean temporary install in CI on Linux and macOS
  • update all end-user documentation to use mft-config and document GitHub, tarball, and contributor installation paths
  • move apply journals and backups to a stable per-user state directory so changing the working directory cannot bypass single-use plan enforcement

Safety and publishing

The existing firmware, device-identity, snapshot-hash, confirmation, backup, sequential-write, and full-readback guards remain in place. State now defaults to ~/.mft-config or $XDG_STATE_HOME/mft-config; MFT_CONFIG_STATE_DIR provides an explicit absolute override.

No npm publication is performed. The package is deliberately UNLICENSED and private: true until the repository owner chooses an explicit host-tool license.

Validation

  • npm run check — build and 16 tests pass
  • npm run test:package — packs a 17-file artifact, clean-installs it, verifies both executable names, exercises all command routes, creates an offline plan, and checks the apply confirmation guard
  • npm pack --dry-run --json — no sources, tests, scripts, snapshots, plans, journals, backups, or node_modules
  • read-only Claude Opus review covering packaging, install behavior, compatibility, write safety, and licensing; actionable findings incorporated

Closes #3

@greptile-apps greptile-apps 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.

oveddan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps 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.

oveddan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@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: 6c54d222c7

ℹ️ 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".

Comment thread src/cli.ts
Comment on lines +153 to 155
const stateRoot = stateDirectory();
const journalPath = resolve(stateRoot, "journal.ndjson");
await assertPlanNotConsumed(journalPath, plan.planId);

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 Check the legacy journal during state migration

When upgrading within a plan's 15-minute lifetime, an apply completed by the previous version is recorded only in the working directory's .mft-state/journal.ndjson. This now checks only the new per-user journal, so if the device is restored to the plan's original snapshot, that old plan passes both the consumption and snapshot guards and can write again, breaking the documented single-use guarantee. Consult or migrate the legacy journal before relying exclusively on the new location.

Useful? React with 👍 / 👎.

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.

Package the CLI as the mft-config command

1 participant