fix(strategy): use ~/.stratiki/strategy and company wiki for grounding - #14
fix(strategy): use ~/.stratiki/strategy and company wiki for grounding#14divo12 wants to merge 1 commit into
Conversation
- Add getStratikiStrategyDir() lazy getter - Update ensureStratikiHome() to create strategy directory - Remove unused openWikiStrategyDir constant - Use getStratikiCompanyWikiDir() instead of process.cwd()/openwiki - Call ensureStratikiHome() before saving decisions - Update store documentation to specify ~/.stratiki/strategy Co-authored-by: divo12 <divo12@users.noreply.github.com>
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/runners.ts">
<violation number="1" location="src/cli/runners.ts:441">
P2: Users with decisions created by the previous strategy command lose them from `strategy list` after this change because the store reads only the new directory. Migrate the legacy files or make reads fall back to the old directory before switching writes.</violation>
<violation number="2" location="src/cli/runners.ts:467">
P2: On a fresh Stratiki setup the seed runs against a nonexistent ~/.stratiki/wiki/ because `buildFromDirectory(companyWikiDir)` executes before `ensureStratikiHome()` creates it. `listMarkdownFiles` catches the ENOENT and returns an empty index, so the seed silently produces fully ungrounded goals (`groundedIn: []`) and exits 0 with no warning that grounding had no content. Call `ensureStratikiHome()` before `buildFromDirectory`, and warn when the index contains no grounding pages.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| const strategyDir = getStratikiStrategyDir(); | ||
| const companyWikiDir = getStratikiCompanyWikiDir(); | ||
| const store = new FileStrategyStore(strategyDir); |
There was a problem hiding this comment.
P2: Users with decisions created by the previous strategy command lose them from strategy list after this change because the store reads only the new directory. Migrate the legacy files or make reads fall back to the old directory before switching writes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/cli/runners.ts, line 441:
<comment>Users with decisions created by the previous strategy command lose them from `strategy list` after this change because the store reads only the new directory. Migrate the legacy files or make reads fall back to the old directory before switching writes.</comment>
<file context>
@@ -430,9 +430,15 @@ export async function runStrategyCommand(
+
+ const strategyDir = getStratikiStrategyDir();
+ const companyWikiDir = getStratikiCompanyWikiDir();
+ const store = new FileStrategyStore(strategyDir);
if (command.action === "list") {
</file context>
|
|
||
| const decision = parseDecisionSeed({ description: command.description }); | ||
| const index = await ContextIndex.buildFromDirectory(bookDir); | ||
| const index = await ContextIndex.buildFromDirectory(companyWikiDir); |
There was a problem hiding this comment.
P2: On a fresh Stratiki setup the seed runs against a nonexistent ~/.stratiki/wiki/ because buildFromDirectory(companyWikiDir) executes before ensureStratikiHome() creates it. listMarkdownFiles catches the ENOENT and returns an empty index, so the seed silently produces fully ungrounded goals (groundedIn: []) and exits 0 with no warning that grounding had no content. Call ensureStratikiHome() before buildFromDirectory, and warn when the index contains no grounding pages.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/cli/runners.ts, line 467:
<comment>On a fresh Stratiki setup the seed runs against a nonexistent ~/.stratiki/wiki/ because `buildFromDirectory(companyWikiDir)` executes before `ensureStratikiHome()` creates it. `listMarkdownFiles` catches the ENOENT and returns an empty index, so the seed silently produces fully ungrounded goals (`groundedIn: []`) and exits 0 with no warning that grounding had no content. Call `ensureStratikiHome()` before `buildFromDirectory`, and warn when the index contains no grounding pages.</comment>
<file context>
@@ -458,9 +464,10 @@ export async function runStrategyCommand(
const decision = parseDecisionSeed({ description: command.description });
- const index = await ContextIndex.buildFromDirectory(bookDir);
+ const index = await ContextIndex.buildFromDirectory(companyWikiDir);
try {
const result = decomposeDecision(decision, index);
</file context>
Summary
Fixes the strategy storage location to use
~/.stratiki/strategyand grounds decisions against the company brain wiki as required.Bug Fixed
PR #13 incorrectly used:
openWikiStrategyDirpointing to~/.openwiki/strategypath.join(process.cwd(), "openwiki")for grounding contextChanges
getStratikiStrategyDir()lazy getter returning~/.stratiki/strategyensureStratikiHome()to create strategy directoryopenWikiStrategyDirconstant (unused elsewhere)runStrategyCommandto:getStratikiStrategyDir()for storagegetStratikiCompanyWikiDir()for grounding contextensureStratikiHome()before saving decisions~/.stratiki/strategyStore Path in Code
Storage:
~/.stratiki/strategy/Grounding:
~/.stratiki/wiki/(company brain)Testing
pnpm formatandpnpm lintpassRelated
Fixes incorrect storage location from PR #13 (merged as f0fd99b)
Summary by cubic
Fixes the strategy command to store decisions in
~/.stratiki/strategyand ground against the company wiki instead of the previous openwiki paths (~/.openwiki/strategyandprocess.cwd()/openwiki). This corrects PR #13's incorrect storage location.Written for commit 48caa8b. Summary will update on new commits.