Skip to content

feat(schema): register complete schema for pull_request entity type#309

Open
castor-agent wants to merge 6 commits into
mainfrom
fix/issue-158-pull-request-schema
Open

feat(schema): register complete schema for pull_request entity type#309
castor-agent wants to merge 6 commits into
mainfrom
fix/issue-158-pull-request-schema

Conversation

@castor-agent
Copy link
Copy Markdown
Collaborator

Fixes #158

Registers a complete schema declaration for pull_request entity type in the bootstrap registry with canonical name fields, temporal fields, reference fields, and merge policies.

Summary

  • src/services/schema_definitions.ts: Added linked_issues field (type: string) and reference_fields array declaring three typed edges — author→contact, repo→github_repo, linked_issues→issue — all using REFERS_TO. Bumped schema_version to 1.1. Existing canonical_name_fields ([{composite: ["number","repo"]}, "url"]) and temporal_fields (created_at, merged_at, closed_at) were already present and correct.
  • docs/subsystems/record_types.md: Added pull_request to the Productivity Schema Family table and documented a full Pull Request subsection under §4.2 covering required fields, 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 (composite and url fallback), temporal_fields (three entries with correct event types), reference_fields (all three entries), field declarations, merge policies, and no-dangling-reference-field constraint.
  • docs/testing/automated_test_catalog.md: Regenerated to include the new test file.

Test plan

  • npm run type-check passes (no type errors)
  • tests/unit/pull_request_schema.test.ts passes — 20/20 tests green
  • Full test suite passes (334 files, 3271 tests passed; 2 pre-existing failures unrelated to this change)
  • npm run generate:test-catalog && npm run validate:test-catalog passes
  • npm run lint, npm run format:check, npm run lint:site-copy all pass

🤖 Generated with Claude Code

castor-agent and others added 5 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>
@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
  • Load always-read docs
  • Load conditional docs for touched paths
  • Review PR diff against constraints
  • Post review

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

  • 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.

Register schema for pull_request entity type

1 participant