Skip to content

feat(schema): add exercise_log and exercise_set entity types for per-set tracking#310

Open
castor-agent wants to merge 7 commits into
mainfrom
fix/issue-246-exercise-set-entity-model
Open

feat(schema): add exercise_log and exercise_set entity types for per-set tracking#310
castor-agent wants to merge 7 commits into
mainfrom
fix/issue-246-exercise-set-entity-model

Conversation

@castor-agent
Copy link
Copy Markdown
Collaborator

Fixes #246

Implements the per-set entity model for exercise tracking: each set is stored as an exercise_set entity with a PART_OF relationship to the parent exercise_log session entity. Adds schema declarations, documentation, and MCP instruction guidance.

Summary

  • Updates exercise_log (schema v2.0) from a per-set entity to a workout session container with date, workout_type, duration_minutes, notes, location fields and canonical identity on [date, workout_type]
  • Adds new exercise_set entity type for atomic per-set data: exercise_name, set_number, reps, weight_lbs, weight_kg, duration_seconds, distance_meters with canonical identity on [exercise_name, set_number, date]
  • Documents the exercise_set PART_OF exercise_log relationship model and full store workflow with JSON examples in docs/subsystems/exercise_tracking.md
  • Adds [EXERCISE TRACKING] section to MCP instructions fenced block
  • Adds 24 unit tests covering both entity types (field types, canonical_name_fields, merge policies, metadata, category)

Test plan

  • npm run type-check — clean
  • npm run format:check — clean
  • tests/unit/exercise_schema.test.ts — 24/24 tests pass
  • Full unit test suite — 199 test files pass (2 skipped)
  • npm run validate:test-catalog — catalog up to date

🤖 Generated with Claude Code

castor-agent and others added 6 commits May 19, 2026 18:36
Adds a [GITHUB ENTITY EXTRACTION] section to MCP instructions and a new
docs/subsystems/github_entities.md documenting how to extract and store
GitHub issue, PR, org, and project entities when encountered in email
records. Also adds a pull_request entity type schema to ENTITY_SCHEMAS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds an explicit [STORE-FIRST PROTOCOL] section to the MCP interaction
instructions fenced block in docs/developer/mcp/instructions.md. The
new section makes the external-write store-first rule binding and
unambiguous: agents MUST store intent as a Neotoma entity before
executing any external write action (email send, GitHub issue creation,
calendar event booking, Slack post, webhook trigger, etc.), update the
entity status after the action completes or fails, and never skip the
store step regardless of how trivial the action appears.

The section includes a three-step checklist, entity-type mapping for
common external actions, on-failure behavior, and explicit FORBIDDEN
rules. The existing "External tool store-first" line in
[COMMUNICATION & DISPLAY] is updated to cross-reference the new section.
The design-rationale section label list is updated to include the new
section.

Also adds a Store-first protocol section to docs/foundation/what_to_store.md
explaining the three-step sequence for users and operators.

Fixes #174

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements issue #169.

- --project-local: stores init config in .neotoma/config.json in the
  current directory (project-scoped) instead of ~/.config/neotoma/config.json
  (user-scoped). Project-local config takes precedence over user-level config
  when readEffectiveConfig() is used.

- --safe: dry-run mode that reports what init would do (create directories,
  write config, initialize databases) without making any changes. Outputs
  a human-readable checklist in pretty mode or a JSON object with
  dry_run=true and planned_actions[] when --json is set. Exit 0 if all
  planned actions would succeed.

Also adds:
- writeProjectLocalConfig() and projectLocalConfigPath() helpers in config.ts
- readEffectiveConfig() that merges project-local over user-level config
- Tests in tests/cli/cli_init_flags.test.ts covering both flags
- cli_reference.md documentation with examples and runtime override tables
- Updated automated test catalog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rting instructions

Fixes #160

Changes `issues.reporting_mode` default from `consent` to `proactive` so agents
file issues immediately when a reportable condition is detected, without asking
for permission. Removes the "mode discovery" prompt that asked the user once to
configure their preference on first encounter.

Key changes in docs/developer/mcp/instructions.md [ISSUE REPORTING] section:
- Default mode is now `proactive` (was `consent`)
- Removed mode discovery flow (no longer asks "what reporting mode do you prefer?")
- Added standing-consent statement: Neotoma installation constitutes consent
- Added explicit opt-out path: preference entity with `auto_file_issues: false`
- FORBIDDEN clause explicitly names the consent-prompt patterns agents must not use

Also updates [QA REFLECTION] QA-driven issue filing and Issue reporting lines to
reflect `proactive` as default and reference the `auto_file_issues` preference
opt-out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…158)

Adds reference_fields, linked_issues field, and documentation to the
pull_request schema bootstrap declaration. Specifically:

- src/services/schema_definitions.ts: add linked_issues field (type:
  string) and reference_fields declaring author→contact, repo→github_repo,
  and linked_issues→issue with REFERS_TO edges. All three reference fields
  reference declared schema fields. Bump schema_version to 1.1.
- docs/subsystems/record_types.md: add pull_request to the Productivity
  Schema Family table and add a full Pull Request section under 4.2
  Productivity Types documenting required/optional fields, identity rule,
  aliases, reference fields, and schema registration location.
- tests/unit/pull_request_schema.test.ts: 20 unit tests covering
  ENTITY_SCHEMAS registration, canonical_name_fields (number+repo
  composite and url fallback), temporal_fields (created_at, merged_at,
  closed_at with event types), reference_fields entries (author, repo,
  linked_issues), field declarations, merge policies, and no-dangling-
  reference-field constraint.
- docs/testing/automated_test_catalog.md: regenerated to include the new
  test file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-set entity (#246)

Implements the per-set entity model for exercise tracking: each set is
stored as an `exercise_set` entity with a PART_OF relationship to the
parent `exercise_log` session container.

- Updates `exercise_log` (schema v2.0) to be a workout session container
  (date, workout_type, duration_minutes, notes) with canonical identity
  on [date, workout_type] and a temporal_fields declaration for timeline
  events.
- Adds `exercise_set` entity type for atomic per-set data (exercise_name,
  set_number, reps, weight_lbs, weight_kg, duration_seconds,
  distance_meters) with canonical identity on
  [exercise_name, set_number, date].
- Documents the PART_OF relationship model and store workflow in
  docs/subsystems/exercise_tracking.md.
- Adds [EXERCISE TRACKING] section to MCP instructions fenced block.
- Adds 24 unit tests covering both entity types (identity rules, field
  types, merge policies, metadata).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Claude finished @castor-agent's task —— View job


PR Review in progress

  • Read pr_review_reading_list.md
  • Read always-read docs
  • Read conditional docs for changed paths
  • Review PR diff
  • Post review

@castor-agent
Copy link
Copy Markdown
Collaborator Author

@claude review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Claude finished @castor-agent's task —— View job


PR Review in progress

  • Read pr_review_reading_list.md
  • Read always-read docs
  • Read conditional docs for changed paths (src/services/schema_definitions.ts, src/cli/, docs/developer/mcp/, tests/, new entity types, test catalog)
  • Review PR diff
  • Post review
    · Branch: fix/issue-246-exercise-set-entity-model

Missing commit dcf6235 (use git ls-files in test catalog generator).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@castor-agent
Copy link
Copy Markdown
Collaborator Author

/create_pr skill audit

Automated audit against the /create_pr skill (Neotoma plan ent_8cde942847555a83253dfe5b), which defines the standard PR description structure (Problems / Solutions / UX improvements / Documentation / Test plan / Breaking changes), the pre-PR checklist from .claude/rules/change_guardrails_rules.md, and the functional-change documentation gate (docs entry + docs/site/site_doc_manifest.yaml + docs server surfacing).

Verdict: does not fully meet standards. Gaps below; recommended changes follow each item.

Findings

  • Title is 81 chars (>70 limit).
  • Missing required sections: Problems, Solutions, UX improvements, Documentation, Breaking changes.
  • Breaking changes section MUST be present, even for non-breaking PRs (write No breaking changes.).
  • PR body does not confirm the doc is reachable via the docs server (src/services/docs/) or list the specific docs/...md path under the Documentation section.

Recommended changes

Update the PR description to match the skill template exactly:

## Problems
- <Concrete pain point or gap.>

## Solutions
- <Concrete change made.>

## UX improvements
- <User-visible behavior change, or `No user-visible change.`>

## Documentation
- <docs/... path(s) added or updated; parameters/outputs/examples/error modes covered.>
- <`docs/site/site_doc_manifest.yaml` entry added/updated; docs service tests pass.>
- <Or: `No functional change; no user-facing docs required.`>

## Test plan
- [ ] `npm run type-check`
- [ ] `npm test`
- [ ] `npm test -- src/services/docs` (if docs changed)
- [ ] Manual verification: <steps>

## Breaking changes
No breaking changes.

## Related
- Plan: <Neotoma plan entity_id or docs/ path>
- Issue(s): <#N>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Functional surfaces detected from the diff: CLI, MCP, Schema. Per the skill, the Documentation section must point at a real docs/...md path covering parameters, outputs, at least one example, and error modes, and the doc must be listed in docs/site/site_doc_manifest.yaml so it is surfaced by the docs server and docs site.

Posted by /create_pr skill audit run. See .claude/skills/create_pr/SKILL.md for the full template.

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.

exercise_log schema collapses per-set data into single entity — sets not individually queryable

1 participant