Skip to content

feat(strategy): add minimal strategy layer on top of company brain - #13

Merged
cursor[bot] merged 5 commits into
mainfrom
cursor/strategy-layer-927a
Sep 1, 2026
Merged

feat(strategy): add minimal strategy layer on top of company brain#13
cursor[bot] merged 5 commits into
mainfrom
cursor/strategy-layer-927a

Conversation

@divo12

@divo12 divo12 commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a minimal strategy layer that decomposes decisions into goals grounded in the existing company brain (book context). This implements the smallest viable slice of the strategy system from the research requirements.

Changes

  • Strategy module (src/strategy/)

    • types.ts: Decision and Goal domain types with status tracking
    • parser.ts: Decision seed parser with validation (500 char max)
    • decomposer.ts: Goal decomposition grounded in book context via FTS5 search
    • store.ts: File-based persistence under openwiki/.strategy/
  • CLI commands

    • stratiki strategy seed <description> - Seed a new decision and generate grounded goals
    • stratiki strategy list - List all seeded decisions and their goals
  • Tests

    • test/strategy/parser.test.ts - Decision validation tests
    • test/strategy/decomposer.test.ts - Goal decomposition and ranking tests with fixture wikis

How it works

  1. User seeds a decision via CLI or (future) page
  2. Decision is parsed and validated
  3. System searches book context for relevant knowledge
  4. Decision is decomposed into goals
  5. Goals are ranked by how well they're grounded in existing company knowledge
  6. Results stored in .strategy/ alongside the book

Example usage

# Seed a decision
stratiki strategy seed "Improve API authentication security"

# Output shows goals ranked by grounding quality:
# - [rank 110] Improve API authentication security
#   Grounded in: /architecture/api.md, /operations/security.md
# - [rank 105] Add monitoring for auth failures
#   Grounded in: /operations/monitoring.md

# List all decisions
stratiki strategy list

Testing

  • All new tests pass (parser validation, goal decomposition, ranking)
  • Existing test failures are unrelated (sqlite FTS5 module issues that existed before this PR)
  • pnpm format and pnpm lint pass cleanly

Notes

  • Reuses company mode home (~/.stratiki) and book context
  • No scheduler, no agent runtime, no Horizon dependencies
  • Goals ranked by grounding quality - better grounded = higher priority
  • Failed/stale goal tracking via status field (future use)
  • Thin contract for future execution layer

Related

Builds on company mode from PR #12 (merged). Does not reopen PR #11 or import from langchain-ai/openwiki.

Open in Web Open in Cursor 

Summary by cubic

Adds a minimal strategy layer that turns seeded decisions into goals grounded in the company book, exposing two new CLI commands (stratiki strategy seed|list). Previously there was no way to record decisions or track goals; now users can seed a decision and get ranked goals backed by existing wiki knowledge, persisted in the shared stratiki home under strategy/. The latest merge from main left an unresolved conflict in src/cli/cli.tsx, so the branch is not currently mergeable.

New Features

  • New src/strategy/ module with decision parsing (validates non-empty, ≤500 chars), goal decomposition via book context search, and file-based persistence.
  • New CLI commands: stratiki strategy seed <description> generates and scores goals by grounding quality, and stratiki strategy list shows all decisions and goal counts.
  • Goal ranking and status fields form a thin contract for a future execution layer; no scheduler or agent runtime is included.

Written for commit 0ec92c5. Summary will update on new commits.

Review in cubic

cursoragent and others added 4 commits September 1, 2026 06:41
- Add strategy module with Decision and Goal types
- Implement decision seed parser with validation
- Add goal decomposer that grounds decisions in book context
- Add file-based strategy store under .strategy/
- Add CLI commands: stratiki strategy seed|list
- Add tests for parser and decomposer with fixture wikis
- Goals are ranked by grounding quality from existing knowledge

Co-authored-by: divo12 <divo12@users.noreply.github.com>
- Add 'as Decision[]' and 'as Goal[]' type assertions
- Fix lint errors in runners and tests
- Create immutable copy for sort operations

Co-authored-by: divo12 <divo12@users.noreply.github.com>
….strategy

- Use openWikiStrategyDir from openwiki-home helpers
- Reuse existing company-mode home infrastructure
- Add strategy dir to ensureOpenWikiHome initialization
- Update store documentation to reflect correct location

Co-authored-by: divo12 <divo12@users.noreply.github.com>
Co-authored-by: divo12 <divo12@users.noreply.github.com>
@divo12
divo12 marked this pull request as ready for review September 1, 2026 06:51
Co-authored-by: divo12 <divo12@users.noreply.github.com>
@cursor
cursor Bot merged commit f0fd99b into main Sep 1, 2026
3 of 9 checks passed
cursor Bot pushed a commit that referenced this pull request Sep 1, 2026
Co-authored-by: divo12 <divo12@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Sep 1, 2026
…9b0f"

This reverts commit ed897ac.

Note: The actual changes were already reverted by 3eb932e which reverted
PR #13 (which was built on top of #12). This commit maintains the explicit
revert history as requested.

Co-authored-by: divo12 <divo12@users.noreply.github.com>
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