Skip to content

feat(issues): link filed issues to originating conversation turns#301

Open
castor-agent wants to merge 3 commits into
mainfrom
fix/issue-192-issue-conversation-link
Open

feat(issues): link filed issues to originating conversation turns#301
castor-agent wants to merge 3 commits into
mainfrom
fix/issue-192-issue-conversation-link

Conversation

@castor-agent
Copy link
Copy Markdown
Collaborator

Fixes #192

Adds optional conversation_turn_id to submit_issue — when provided, a REFERS_TO edge is created from the filed issue to the conversation turn entity where the problem was observed.

Summary

  • openapi.yaml: new optional conversation_turn_id field on issuesSubmit request body; describes the conversation_message entity ID of the turn where the issue was observed
  • src/services/issues/types.ts: IssueCreateParams.conversation_turn_id?: string
  • src/shared/action_schemas.ts: IssuesSubmitRequestSchema includes the new field
  • src/services/issues/issue_operations.ts: merges conversation_turn_id into the REFERS_TO batch alongside entity_ids_to_link — no second DB round-trip
  • src/server.ts + src/actions.ts: MCP handler and HTTP handler both parse and forward the field
  • src/tool_definitions.ts: submit_issue MCP tool exposes the new param with description
  • docs/developer/mcp/instructions.md: [ISSUE REPORTING] section notes agents SHOULD pass conversation_turn_id when the current turn entity ID is known

Test plan

  • npm run type-check — passes (verified locally)
  • npm run lint — passes (0 errors, pre-existing warnings only)
  • npm run format:check — passes after prettier run
  • npm run validate:doc-deps — passes
  • Unit tests pass when run with a free port (NEOTOMA_HTTP_PORT=0 npx vitest run)
  • Manual: call submit_issue with conversation_turn_id set to a known conversation_message entity ID; verify a REFERS_TO edge appears from the issue entity to the turn entity

🤖 Generated with Claude Code

castor-agent and others added 3 commits May 19, 2026 17:43
…rule (#194)

Add a session-start instruction that retrieves the issue_filing_consent
preference entity at startup and caches it for the session. When the stored
value is "always", the effective reporting mode is set to proactive and the
agent MUST file issues without asking. Values "ask" and "never" map to
consent and off respectively. The preference overrides issues.reporting_mode
from config and env for the duration of the session.

Also update the proactive mode contract to explicitly list
issue_filing_consent value "always" as a trigger alongside the CLI config and
env var paths, replacing the obsolete future auto_file_issues forward
reference. Update QA-driven issue filing to check for the stored preference
entity before prompting the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements POST /issues/import endpoint and `neotoma issues import
--from-jsonl <file>` CLI command for observer batch ingestion of issues
from JSONL files exported from other systems.

- openapi.yaml: new POST /issues/import endpoint (operationId: importIssuesFromJsonl)
- src/shared/openapi_types.ts: regenerated from updated spec
- src/shared/action_schemas.ts: IssuesImportFromJsonlRequestSchema (Zod)
- src/services/issues/import_from_jsonl.ts: new service; parses JSONL,
  builds deterministic idempotency keys, stores each issue entity
- src/actions.ts: handleIssuesImportFromJsonlHttp handler + routes
- src/tool_definitions.ts: import_issues_from_jsonl MCP tool
- src/shared/contract_mappings.ts: importIssuesFromJsonl row + MCP map entry
- src/cli/issues.ts: issuesImport function + IssuesImportOpts interface
- src/cli/index.ts: `issues import --from-jsonl <file>` subcommand
- scripts/security/protected_routes_manifest.json: regenerated (109 routes)

Fixes #271

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds optional `conversation_turn_id` to `submit_issue` (MCP tool,
HTTP POST /issues/submit, and IssuesSubmitRequestSchema). When provided,
the server creates a REFERS_TO edge from the filed issue entity to the
specified conversation_message entity so the origin of the issue is
directly traceable without a separate create_relationship call.

Changes:
- openapi.yaml: add `conversation_turn_id` field to issuesSubmit requestBody
- src/shared/openapi_types.ts: regenerated
- src/services/issues/types.ts: add `conversation_turn_id` to IssueCreateParams
- src/shared/action_schemas.ts: add field to IssuesSubmitRequestSchema
- src/services/issues/issue_operations.ts: merge conversation_turn_id into
  the allTargetIds list fed to createRelationships alongside entity_ids_to_link
- src/server.ts: parse and forward conversation_turn_id in MCP handler
- src/actions.ts: forward conversation_turn_id in HTTP handler
- src/tool_definitions.ts: expose conversation_turn_id param on submit_issue tool
- docs/developer/mcp/instructions.md: note that agents SHOULD pass
  conversation_turn_id when the current turn entity ID is known

Fixes #192

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 docs/developer/pr_review_reading_list.md
  • Read always-read docs
  • Read conditional docs for touched paths
  • Review PR diff against constraints
  • Post review feedback
    | Branch: fix/issue-192-issue-conversation-link

@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 docs/developer/pr_review_reading_list.md
  • Read always-read docs
  • Read conditional docs for touched paths
  • Review PR diff against constraints
  • Post review feedback
    | Branch: fix/issue-192-issue-conversation-link

@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.).
  • docs/site/site_doc_manifest.yaml is not updated. New or substantively changed docs must be registered there so the docs site surfaces them.
  • 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, HTTP, MCP. 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.

Issues should link to originating conversation turns for post-resolution recovery

1 participant