feat(ingestion): auto-extract awaiting-reply tasks from outbound emails#303
feat(ingestion): auto-extract awaiting-reply tasks from outbound emails#303castor-agent wants to merge 4 commits into
Conversation
…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>
Implements #176. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @castor-agent's task —— View job PR Review In Progress
|
|
@claude review |
|
Claude finished @castor-agent's task —— View job PR Review In Progress
|
/create_pr skill auditAutomated audit against the Verdict: does not fully meet standards. Gaps below; recommended changes follow each item. Findings
Recommended changesUpdate 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, Schema. Per the skill, the Posted by |

Fixes #176
Summary
derived_entitiesdeclarative field toSchemaDefinitionso schemas can express rules for auto-creating linked entities during ingestion — no hardcodedif (entityType === "email")branches.schema_derived_entity_extraction.tswith pure-function condition evaluation (evaluateCondition), field resolution (resolveDerivedField), and the asyncextractDerivedEntitiesorchestrator that re-usesstoreStructuredForApifor uniform store semantics and creates aREFERS_TOrelationship back to the source entity.storeStructuredForApipost-store path (non-fatal; failures are logged and skipped).derived_entitiesrule: whendirection = "outbound"and body contains any pending-reply signal (?,please let me know,looking forward to hearing,please reply,awaiting your response,let me know,your thoughts,waiting to hear), creates a task withtask_type: "awaiting_reply",status: "pending",due_context: "reply expected", title"Awaiting reply: {{subject}}".directionfield to email schema andtask_type/due_contextfields to task schema.Test plan
npm run type-checkpassesnpm testpasses (41 new unit tests intests/unit/schema_derived_entity_extraction.test.ts)direction: "outbound"and a body containing?— verify a linkedawaiting_replytask is auto-createddirection: "outbound"and a neutral body — verify no task is createddirection: "inbound"and a question body — verify no task is created🤖 Generated with Claude Code