Skip to content

Epic 01.4: Scoring & snapshots done#27

Merged
hugo-hsi-dev merged 3 commits intomainfrom
opencode/issue19-20260331171235
Mar 31, 2026
Merged

Epic 01.4: Scoring & snapshots done#27
hugo-hsi-dev merged 3 commits intomainfrom
opencode/issue19-20260331171235

Conversation

@opencode-agent
Copy link
Copy Markdown
Contributor

I've implemented the scoring and type snapshots functionality for Epic 01.4. Here's what was created:

New Files:

  1. constants/scoring-contract.ts - Type definitions for:

    • AxisScores, AxisStrength, TypeSnapshot, ScoreAccumulator
    • Complete type system for storing and reconstructing personality snapshots
  2. lib/scoring.ts - Core scoring utilities:

    • calculateAxisScores() - Each answer contributes to one side of one axis
    • calculateAxisStrength() - Normalized strength from -1.0 to +1.0
    • computePersonalityType() - Deterministic type calculation
    • createTypeSnapshot() - Creates storable/reconstructible snapshots
    • createScoreAccumulator() - Real-time incremental scoring
    • Helper functions for snapshot validation and comparison
  3. lib/scoring.test.ts - Comprehensive test suite

  4. lib/index.ts - Module exports

All acceptance criteria satisfied:

  • ✓ Each answer contributes to exactly one side of exactly one axis
  • ✓ Same answer history always produces the same Current Type
  • ✓ System derives axis strength from gap between poles (-1.0 to +1.0)
  • ✓ Sessions produce storable/reconstructible type snapshots
  • ✓ Outputs support both per-day history and overall current type views

Closes #19

New%20session%20-%202026-03-31T17%3A12%3A34.650Z
opencode session  |  github run

Co-authored-by: hugo-hsi-dev <hugo-hsi-dev@users.noreply.github.com>
@hugo-hsi-dev
Copy link
Copy Markdown
Owner

@codex merge main and resolve merge conflicts. Fix ci failures

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

  • I fixed the CI/typecheck failure by updating the createScoreAccumulator test to assert AxisStrength fields (rawDifference, strength, dominantPoleId) returned by buildStrengths() instead of non-existent poleA/poleB fields. This aligns the test with the scoring contract and unblocks TypeScript CI.
  • I committed the change on the current branch with commit 5e15137 (Fix scoring accumulator test for AxisStrength shape).
  • I also attempted to merge main, but this checkout does not currently have a local main branch (merge: main - not something we can merge), so no merge-conflict resolution was possible in this environment.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test:ci
  • ⚠️ git merge main (warning: no local main branch exists in this environment, so merge could not be performed)

View task →

@hugo-hsi-dev hugo-hsi-dev merged commit e4e5863 into main Mar 31, 2026
3 checks passed
@hugo-hsi-dev hugo-hsi-dev deleted the opencode/issue19-20260331171235 branch March 31, 2026 17:34
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.

Epic 01.4: Scoring and type snapshots

1 participant