Skip to content

Commit a7de5cc

Browse files
committed
chore: address feedback
1 parent 59b138b commit a7de5cc

9 files changed

Lines changed: 26 additions & 54 deletions

File tree

packages/cli/src/bin/stash.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ ${messages.cli.usagePrefix}${STASH} <command> [options]
7878
Commands:
7979
init Initialize CipherStash for your project
8080
plan Draft a reviewable encryption plan at .cipherstash/plan.md
81-
impl Execute an encryption plan (or implement without one with --continue-without-plan)
82-
status Show project lifecycle: init done? plan written? implementation engaged?
81+
impl Execute the plan with a local agent
82+
status Displays implementation status
8383
auth <subcommand> Authenticate with CipherStash
8484
wizard AI-guided encryption setup (reads your codebase)
8585
@@ -111,7 +111,7 @@ Init Flags:
111111
--drizzle Use Drizzle-specific setup flow
112112
113113
Impl Flags:
114-
--continue-without-plan Skip the planning checkpoint and go straight to implementation
114+
--continue-without-plan Skip planning and go straight to implementation
115115
(interactively confirms before proceeding)
116116
117117
DB Flags:

packages/cli/src/commands/impl/index.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,10 @@ import {
99
CONTEXT_REL_PATH,
1010
type ContextFile,
1111
} from '../init/lib/write-context.js'
12-
import {
13-
CancelledError,
14-
type InitProvider,
15-
type InitState,
16-
} from '../init/types.js'
12+
import { CancelledError, type InitState } from '../init/types.js'
1713
import { detectPackageManager, runnerCommand } from '../init/utils.js'
1814
import { howToProceedStep } from './steps/how-to-proceed.js'
1915

20-
/**
21-
* The handoff steps in `impl/steps/handoff-*.ts` accept an `InitProvider`
22-
* but ignore it. Stub keeps the type signature happy without pretending
23-
* impl has provider-specific behaviour.
24-
*/
25-
const STUB_PROVIDER: InitProvider = {
26-
name: 'impl',
27-
introMessage: '',
28-
getNextSteps: () => [],
29-
}
30-
3116
function buildStateFromContext(
3217
ctx: ContextFile,
3318
agents: AgentEnvironment,
@@ -46,15 +31,14 @@ function buildStateFromContext(
4631
}
4732

4833
/**
49-
* Confirm "are you sure?" before implementing without a plan. The
50-
* default-no on the confirm is the security stance — passing through
51-
* the planning checkpoint by accident is the failure mode we're guarding
52-
* against.
34+
* Confirm before launching implementation when the user has chosen to
35+
* skip the planning checkpoint. Default-no is the security stance —
36+
* passing through this prompt by accident is the failure mode we're
37+
* guarding against.
5338
*/
5439
async function confirmContinueWithoutPlan(): Promise<void> {
5540
const confirmed = await p.confirm({
56-
message:
57-
'Implementing without a plan commits you to ~45–60 min of agent work. Continue?',
41+
message: 'Implementation can take some time. Continue?',
5842
initialValue: false,
5943
})
6044
if (p.isCancel(confirmed) || !confirmed) {
@@ -168,7 +152,7 @@ export async function implCommand(flags: Record<string, boolean>) {
168152
const agents = detectAgents(cwd, process.env)
169153
const state = buildStateFromContext(ctx, agents)
170154

171-
await howToProceedStep.run(state, STUB_PROVIDER)
155+
await howToProceedStep.run(state)
172156

173157
p.outro(
174158
`Implementation handoff complete. Run \`${cli} db status\` to verify state.`,

packages/cli/src/commands/impl/steps/handoff-agents-md.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const AGENTS_MD_REL_PATH = 'AGENTS.md'
2828
export const handoffAgentsMdStep: InitStep = {
2929
id: 'handoff-agents-md',
3030
name: 'Write AGENTS.md',
31-
async run(state: InitState, _provider: InitProvider): Promise<InitState> {
31+
async run(state: InitState, _provider?: InitProvider): Promise<InitState> {
3232
const cwd = process.cwd()
3333
const integration = state.integration ?? 'postgresql'
3434

packages/cli/src/commands/impl/steps/handoff-claude.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const CLAUDE_INSTALL_URL = 'https://code.claude.com/docs/en/quickstart'
2121
export const handoffClaudeStep: InitStep = {
2222
id: 'handoff-claude',
2323
name: 'Hand off to Claude Code',
24-
async run(state: InitState, _provider: InitProvider): Promise<InitState> {
24+
async run(state: InitState, _provider?: InitProvider): Promise<InitState> {
2525
const cwd = process.cwd()
2626
const integration = state.integration ?? 'postgresql'
2727

packages/cli/src/commands/impl/steps/handoff-codex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const CODEX_INSTALL_URL = 'https://github.com/openai/codex'
2828
export const handoffCodexStep: InitStep = {
2929
id: 'handoff-codex',
3030
name: 'Hand off to Codex',
31-
async run(state: InitState, _provider: InitProvider): Promise<InitState> {
31+
async run(state: InitState, _provider?: InitProvider): Promise<InitState> {
3232
const cwd = process.cwd()
3333
const integration = state.integration ?? 'postgresql'
3434

packages/cli/src/commands/impl/steps/handoff-wizard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { runWizardSpawn } from '../../wizard/index.js'
2323
export const handoffWizardStep: InitStep = {
2424
id: 'handoff-wizard',
2525
name: 'Use the CipherStash Agent',
26-
async run(state: InitState, _provider: InitProvider): Promise<InitState> {
26+
async run(state: InitState, _provider?: InitProvider): Promise<InitState> {
2727
const cwd = process.cwd()
2828
const envKeys = state.envKeys ?? []
2929

packages/cli/src/commands/impl/steps/how-to-proceed.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function buildOptions(
8282
export const howToProceedStep: InitStep = {
8383
id: 'how-to-proceed',
8484
name: 'How to proceed',
85-
async run(state: InitState, provider: InitProvider): Promise<InitState> {
85+
async run(state: InitState, _provider?: InitProvider): Promise<InitState> {
8686
const mode: InitMode = state.mode ?? 'implement'
8787
const message =
8888
mode === 'plan'
@@ -101,13 +101,13 @@ export const howToProceedStep: InitStep = {
101101

102102
switch (choice) {
103103
case 'claude-code':
104-
return handoffClaudeStep.run(next, provider)
104+
return handoffClaudeStep.run(next)
105105
case 'codex':
106-
return handoffCodexStep.run(next, provider)
106+
return handoffCodexStep.run(next)
107107
case 'agents-md':
108-
return handoffAgentsMdStep.run(next, provider)
108+
return handoffAgentsMdStep.run(next)
109109
case 'wizard':
110-
return handoffWizardStep.run(next, provider)
110+
return handoffWizardStep.run(next)
111111
}
112112
},
113113
}

packages/cli/src/commands/init/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ export interface InitState {
6767
export interface InitStep {
6868
id: string
6969
name: string
70-
run(state: InitState, provider: InitProvider): Promise<InitState>
70+
/** `provider` is optional. The init pipeline passes one (it owns
71+
* intro copy and provider-specific defaults); the post-init handoff
72+
* steps invoked by `stash plan` / `stash impl` don't have a provider
73+
* to give and don't use one. */
74+
run(state: InitState, provider?: InitProvider): Promise<InitState>
7175
}
7276

7377
export interface InitProvider {

packages/cli/src/commands/plan/index.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,9 @@ import {
99
CONTEXT_REL_PATH,
1010
type ContextFile,
1111
} from '../init/lib/write-context.js'
12-
import {
13-
CancelledError,
14-
type InitProvider,
15-
type InitState,
16-
} from '../init/types.js'
12+
import { CancelledError, type InitState } from '../init/types.js'
1713
import { detectPackageManager, runnerCommand } from '../init/utils.js'
1814

19-
/**
20-
* `stash plan` borrows the same handoff machinery as `stash impl`. The
21-
* handoff steps don't actually use the provider (their `run` signatures
22-
* take `_provider`); the abstraction is an init-time concept for intro
23-
* copy. A stub satisfies the type.
24-
*/
25-
const STUB_PROVIDER: InitProvider = {
26-
name: 'plan',
27-
introMessage: '',
28-
getNextSteps: () => [],
29-
}
30-
3115
function buildStateFromContext(
3216
ctx: ContextFile,
3317
agents: AgentEnvironment,
@@ -82,7 +66,7 @@ export async function planCommand() {
8266
const agents = detectAgents(cwd, process.env)
8367
const state = buildStateFromContext(ctx, agents)
8468

85-
await howToProceedStep.run(state, STUB_PROVIDER)
69+
await howToProceedStep.run(state)
8670

8771
// Chain into `stash impl` so the user doesn't have to copy/paste. Lazy
8872
// import avoids a circular module load — plan and impl both pull from

0 commit comments

Comments
 (0)