Skip to content

feat(#511): add thesis diff and rollup queries#552

Merged
adolago merged 1 commit intomainfrom
issue-511-thesis-diffs
Mar 15, 2026
Merged

feat(#511): add thesis diff and rollup queries#552
adolago merged 1 commit intomainfrom
issue-511-thesis-diffs

Conversation

@adolago
Copy link
Copy Markdown
Owner

@adolago adolago commented Mar 15, 2026

Summary

  • add a dedicated thesis query layer with thesis read/list/history/diff APIs and portfolio thesis rollup views
  • expose the new surfaces through zee:invest-thesis and zee investing thesis ... commands
  • document the stable diff and rollup contracts and add regression tests plus telemetry for query and rollup usage

Validation

  • bash scripts/bun-audit-ci.sh
  • bash scripts/verify-skills.sh
  • bun run --cwd packages/zee typecheck
  • bun test --cwd packages/zee test/investing/thesis-queries.test.ts test/investing/thesis-ledger.test.ts test/investing/portfolio-briefings.test.ts
  • CI=true bun test --cwd packages/zee --reporter=dots --coverage-reporter=lcov
  • cd packages/zee && bun run build
  • cd packages/zee && ./script/verify-binary.sh
  • seeded thesis state locally and exercised zee investing thesis rollup --json against the built binary

Closes #511

@adolago adolago merged commit d6921b8 into main Mar 15, 2026
5 of 6 checks passed
@adolago adolago deleted the issue-511-thesis-diffs branch March 15, 2026 16:17
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 4c6a11308f

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

valuation: record?.valuation ?? null,
}
}),
...watchlist.map((entry) => {
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 De-duplicate watchlist symbols already present in holdings

This mapping appends every watchlist symbol even when the same symbol is already in holdings, so a name that appears in both files is counted twice in entries, countsByPosture, countsByConviction, and coverage totals. In that scenario the rollup can overstate thesis coverage and skew posture/conviction distribution, which makes the portfolio summary inaccurate for operators.

Useful? React with 👍 / 👎.

.filter((entry) => (input?.posture ? entry.thesis?.posture === input.posture : true))
.filter((entry) => (input?.conviction ? entry.thesis?.conviction === input.conviction : true))
.sort(sortRollupEntries)
.slice(0, input?.limit ?? 50)
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 Compute coverage before truncating rollup entries

Applying .slice(0, input?.limit ?? 50) before deriving coverage, tracked, and missing causes undercounted metrics whenever the filtered portfolio has more symbols than the limit. In those cases the rollup summary and emitted rollup telemetry report partial coverage as if it were full portfolio coverage, which can hide missing-thesis gaps in larger books.

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.

[child] thesis diff/query APIs and portfolio rollup views

1 participant