Skip to content

Refactor context engine boundaries and daemon reconciliation - #1057

Merged
Dsantra92 merged 70 commits into
mainfrom
refactor/context-runtime-boundary
Aug 28, 2026
Merged

Refactor context engine boundaries and daemon reconciliation#1057
Dsantra92 merged 70 commits into
mainfrom
refactor/context-runtime-boundary

Conversation

@Dsantra92

@Dsantra92 Dsantra92 commented Aug 20, 2026

Copy link
Copy Markdown
Member

Performs a Context Runtime Boundary migration: one importable context-bound engine, one Potpie-owned resource manager, one typed local/daemon execution contract, and one canonical foreground daemon launched with python -m potpie.daemon.

This PR replaces the reflective HostShell/RemoteHostShell architecture and removes the standalone Context Core boundary. It preserves existing CLI JSON envelopes and exit categories, with the approved addition of explicit confirmation for destructive graph operations.

Architecture

  • Adds the async, immutable-context ContextEngine facade with typed requests, results, outcomes, and idempotent lifecycle.
  • Adds ContextResourceManager and AuthorizedContextLease for selection, authentication, authorization, dependency ownership, caching, and deterministic shutdown.
  • Routes in-process and daemon execution through matching LocalEngineClient and DaemonEngineClient operations.
  • Adds a finite, versioned daemon protocol with request correlation, authenticated handshake, typed failures, safety metadata, and no mutation replay after an ambiguous transport failure.
  • Uses an owner-only Unix-domain socket locally, with authenticated loopback TCP fallback and one canonical discovery/credential format. In-process execution does not exchange a bearer token.
  • Routes daemon lifecycle through an external controller that creates and observes the foreground python -m potpie.daemon process.
  • Requires confirmation for destructive graph import and repair; machine mode uses --yes, and a human decline is returned as a typed local cancellation.

Removed legacy architecture

  • Reflective /rpc and /attr routes and Python-class wire codecs.
  • RemoteHostShell, RemoteSurface, and the reflective daemon client/server.
  • The dormant candidate daemon runtime and duplicate discovery paths.
  • HostShell, build_host_shell, get_host, set_host, temporary runtime adapters, and the migration allowlist.
  • The potpie-context-core package and dependencies.

Permanent AST/TOML architecture tests prevent these symbols, imports, routes, packages, and entrypoints from returning.

Review guide

The commits are intentionally ordered as independently reviewable migration slices:

  1. Contracts and architecture decisions.
  2. Additive Context Engine, Resource Manager, client, protocol, and daemon foundations.
  3. Caller migration and the single canonical daemon cutover.
  4. Reflective runtime, host compatibility, and Context Core deletion.
  5. Permanent architecture enforcement, corrective CLI safety slices, and final conformance records.

Establish accepted ownership contracts for the importable Context Engine,
Potpie resource management, the daemon, and CLI human/machine boundaries.

Record typed daemon, context isolation, explicit composition, destructive
intent, and deferred parsing, extension, and protocol decisions without
claiming implementation conformance.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 550 files, which is 250 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 423323c7-2150-466e-9f88-604c67d2fbab

📥 Commits

Reviewing files that changed from the base of the PR and between b453231 and b99ad4d.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (550)
  • .github/workflows/test.yml
  • .pre-commit-config.yaml
  • build_config_values.py
  • distribution_defaults_hook.py
  • docs/context-graph/architecture.md
  • docs/context-graph/cli-flow.md
  • docs/context-graph/index.md
  • docs/context-graph/ingestion-nudge.md
  • docs/context-graph/observability.md
  • docs/context-graph/querying.md
  • docs/context-graph/skills.md
  • docs/context-graph/vision.md
  • docs/telemetry/sentry.md
  • potpie/agent_context.py
  • potpie/auth/__init__.py
  • potpie/auth/adapters/__init__.py
  • potpie/auth/adapters/atlassian_client.py
  • potpie/auth/adapters/atlassian_read_client.py
  • potpie/auth/adapters/callback_server.py
  • potpie/auth/adapters/credentials.py
  • potpie/auth/adapters/credentials_store.py
  • potpie/auth/adapters/e2e_keyring.py
  • potpie/auth/adapters/errors.py
  • potpie/auth/adapters/firebase_session.py
  • potpie/auth/adapters/gitbucket_client.py
  • potpie/auth/adapters/gitbucket_read_client.py
  • potpie/auth/adapters/github.py
  • potpie/auth/adapters/gitlab_client.py
  • potpie/auth/adapters/gitlab_read_client.py
  • potpie/auth/adapters/http.py
  • potpie/auth/adapters/integration_profile.py
  • potpie/auth/adapters/integration_session.py
  • potpie/auth/adapters/integration_verify.py
  • potpie/auth/adapters/linear_read_client.py
  • potpie/auth/adapters/local_identity.py
  • potpie/auth/adapters/models.py
  • potpie/auth/adapters/oauth_client_id_messages.py
  • potpie/auth/adapters/pkce.py
  • potpie/auth/adapters/potpie.py
  • potpie/auth/adapters/potpie_api_config.py
  • potpie/auth/adapters/provider_config.py
  • potpie/auth/adapters/token_exchange.py
  • potpie/auth/ports/__init__.py
  • potpie/auth/ports/credentials.py
  • potpie/auth/ports/identity.py
  • potpie/auth/wiring.py
  • potpie/cli/README.md
  • potpie/cli/auth/_login_impl.py
  • potpie/cli/auth/atlassian_auth.py
  • potpie/cli/auth/atlassian_read.py
  • potpie/cli/auth/auth_commands.py
  • potpie/cli/auth/gitbucket_commands.py
  • potpie/cli/auth/github_commands.py
  • potpie/cli/auth/gitlab_auth.py
  • potpie/cli/auth/gitlab_commands.py
  • potpie/cli/auth/gitlab_read.py
  • potpie/cli/auth/linear_read.py
  • potpie/cli/commands/__init__.py
  • potpie/cli/commands/_common.py
  • potpie/cli/commands/auth.py
  • potpie/cli/commands/bootstrap.py
  • potpie/cli/commands/cloud.py
  • potpie/cli/commands/daemon.py
  • potpie/cli/commands/graph.py
  • potpie/cli/commands/ledger.py
  • potpie/cli/commands/pots.py
  • potpie/cli/commands/query.py
  • potpie/cli/commands/skills.py
  • potpie/cli/commands/ui.py
  • potpie/cli/main.py
  • potpie/cli/read_presenter.py
  • potpie/cli/telemetry/identity_store.py
  • potpie/cli/telemetry/onboarding_events.py
  • potpie/cli/telemetry/preferences.py
  • potpie/cli/telemetry/sentry_privacy.py
  • potpie/cli/telemetry/settings.py
  • potpie/cli/ui/output.py
  • potpie/cli/ui/setup_ux.py
  • potpie/config/__init__.py
  • potpie/config/contracts.py
  • potpie/config/local.py
  • potpie/config/local_paths.py
  • potpie/config/local_state.py
  • potpie/context-core/pyproject.toml
  • potpie/context-core/tests/conftest.py
  • potpie/context-engine/pyproject.toml
  • potpie/context-engine/scripts/generate_agent_contract.py
  • potpie/context-engine/sentry_defaults_hook.py
  • potpie/context-engine/src/potpie_context_engine/__init__.py
  • potpie/context-engine/src/potpie_context_engine/adapters/inbound/http/api/v1/context/router.py
  • potpie/context-engine/src/potpie_context_engine/adapters/inbound/http/webhooks/integrations/github.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/connectors/_bench_stubs.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/connectors/github/connector.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/connectors/github/resolver.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/connectors/notion/connector.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/_mutation_execution.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/apply_plan.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/__init__.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/_unimplemented.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/claim_query_analytics.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/claim_query_semantic.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/embedded_backend.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/falkordb_analytics.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/falkordb_backend.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/in_memory_backend.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/neo4j_backend.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/backends/stub_backend.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/canonical_claim_query.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/context_graph_service.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/cypher.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/entity_label_repair.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/entity_summary_repair.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/falkordb_inspection.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/falkordb_reader.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/falkordb_writer.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/in_memory_reader.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/inbox_stores/local_json.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/neo4j_reader.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/neo4j_writer.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/plan_stores/local_json.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/graph/writer_port.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/http/potpie_context_api_client.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/install/__init__.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/ledger/cursor_store.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/ledger/managed_client.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/ledger/self_hosted_client.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/local_paths.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/policy/default.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/postgres/ingestion_event_store.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/postgres/reconciliation_ledger.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/pots/__init__.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/reconciliation/context_graph_tools.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/reconciliation/factory.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/reconciliation/llm_plan_convert.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/reconciliation/pydantic_deep_agent.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/session/injection_ledger.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/skills/__init__.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/source_resolvers/composite.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/source_resolvers/documentation.py
  • potpie/context-engine/src/potpie_context_engine/adapters/outbound/source_resolvers/null.py
  • potpie/context-engine/src/potpie_context_engine/api.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/_common.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/coding_preferences.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/decisions.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/docs.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/features.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/infra_topology.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/owners.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/prior_bugs.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/raw_graph.py
  • potpie/context-engine/src/potpie_context_engine/application/readers/timeline_reader.py
  • potpie/context-engine/src/potpie_context_engine/application/services/envelope_builder.py
  • potpie/context-engine/src/potpie_context_engine/application/services/event_admission.py
  • potpie/context-engine/src/potpie_context_engine/application/services/graph_service.py
  • potpie/context-engine/src/potpie_context_engine/application/services/ingestion_submission_service.py
  • potpie/context-engine/src/potpie_context_engine/application/services/nudge_service.py
  • potpie/context-engine/src/potpie_context_engine/application/services/read_orchestrator.py
  • potpie/context-engine/src/potpie_context_engine/application/services/source_connector_registry.py
  • potpie/context-engine/src/potpie_context_engine/application/use_cases/process_batch.py
  • potpie/context-engine/src/potpie_context_engine/application/use_cases/record_durable_context.py
  • potpie/context-engine/src/potpie_context_engine/application/use_cases/report_status.py
  • potpie/context-engine/src/potpie_context_engine/application/use_cases/submit_raw_episode.py
  • potpie/context-engine/src/potpie_context_engine/benchmarks/core/local_engine.py
  • potpie/context-engine/src/potpie_context_engine/benchmarks/retrieval_eval.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/cli_auth_wiring.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/container.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/http_projects.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/ingestion_server.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/sentry_metrics_runtime.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/sentry_privacy.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/sentry_settings.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/standalone_container.py
  • potpie/context-engine/src/potpie_context_engine/bootstrap/standalone_env.py
  • potpie/context-engine/src/potpie_context_engine/composition.py
  • potpie/context-engine/src/potpie_context_engine/context_engine.py
  • potpie/context-engine/src/potpie_context_engine/core/__init__.py
  • potpie/context-engine/src/potpie_context_engine/core/actor.py
  • potpie/context-engine/src/potpie_context_engine/core/agent_context_port.py
  • potpie/context-engine/src/potpie_context_engine/core/agent_envelope.py
  • potpie/context-engine/src/potpie_context_engine/core/api.py
  • potpie/context-engine/src/potpie_context_engine/core/canonical_label_inference.py
  • potpie/context-engine/src/potpie_context_engine/core/coherence.py
  • potpie/context-engine/src/potpie_context_engine/core/context_events.py
  • potpie/context-engine/src/potpie_context_engine/core/context_records.py
  • potpie/context-engine/src/potpie_context_engine/core/definition.py
  • potpie/context-engine/src/potpie_context_engine/core/entity_canonicalization.py
  • potpie/context-engine/src/potpie_context_engine/core/episode_mentions.py
  • potpie/context-engine/src/potpie_context_engine/core/errors.py
  • potpie/context-engine/src/potpie_context_engine/core/event_playbooks.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_contract.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_entity_summary.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_history.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_inbox.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_mutations.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_plans.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_quality.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_query.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_views.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_workbench.py
  • potpie/context-engine/src/potpie_context_engine/core/graph_workbench_ontology.py
  • potpie/context-engine/src/potpie_context_engine/core/identity.py
  • potpie/context-engine/src/potpie_context_engine/core/lifecycle.py
  • potpie/context-engine/src/potpie_context_engine/core/llm_reconciliation.py
  • potpie/context-engine/src/potpie_context_engine/core/mutation_policy.py
  • potpie/context-engine/src/potpie_context_engine/core/ontology.py
  • potpie/context-engine/src/potpie_context_engine/core/ontology_classifier.py
  • potpie/context-engine/src/potpie_context_engine/core/playbooks/repo_one_shot_ingestion.md
  • potpie/context-engine/src/potpie_context_engine/core/ports/__init__.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/agent_context.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/claim_query.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/__init__.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/analytics.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/backend.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/inbox_store.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/inspection.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/mutation.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/plan_store.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/semantic.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph/snapshot.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/graph_service.py
  • potpie/context-engine/src/potpie_context_engine/core/ports/pot_resolution.py
  • potpie/context-engine/src/potpie_context_engine/core/py.typed
  • potpie/context-engine/src/potpie_context_engine/core/reconciliation.py
  • potpie/context-engine/src/potpie_context_engine/core/reconciliation_config.py
  • potpie/context-engine/src/potpie_context_engine/core/reconciliation_flags.py
  • potpie/context-engine/src/potpie_context_engine/core/reconciliation_issues.py
  • potpie/context-engine/src/potpie_context_engine/core/reconciliation_validation.py
  • potpie/context-engine/src/potpie_context_engine/core/record_to_semantic.py
  • potpie/context-engine/src/potpie_context_engine/core/runtime.py
  • potpie/context-engine/src/potpie_context_engine/core/semantic_mutation_lowering.py
  • potpie/context-engine/src/potpie_context_engine/core/semantic_mutation_validator.py
  • potpie/context-engine/src/potpie_context_engine/core/semantic_mutations.py
  • potpie/context-engine/src/potpie_context_engine/core/serialization.py
  • potpie/context-engine/src/potpie_context_engine/core/singleton_predicates.py
  • potpie/context-engine/src/potpie_context_engine/core/source_references.py
  • potpie/context-engine/src/potpie_context_engine/core/workbench_service.py
  • potpie/context-engine/src/potpie_context_engine/domain/ingestion_event_models.py
  • potpie/context-engine/src/potpie_context_engine/domain/nudge.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/context_graph.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/ingestion_ledger.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/policy.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/provisioning.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/reconciliation_ledger.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/reconciliation_tools.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/services/__init__.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/source_connector.py
  • potpie/context-engine/src/potpie_context_engine/domain/ports/source_resolver.py
  • potpie/context-engine/src/potpie_context_engine/domain/reconciliation_batch.py
  • potpie/context-engine/src/potpie_context_engine/host/__init__.py
  • potpie/context-engine/src/potpie_context_engine/host/shell.py
  • potpie/context-engine/src/potpie_context_engine/outcomes.py
  • potpie/context-engine/src/potpie_context_engine/requests.py
  • potpie/context-engine/src/potpie_context_engine/results.py
  • potpie/context-engine/src/potpie_context_engine/testing/__init__.py
  • potpie/context-engine/src/potpie_context_engine/testing/conformance.py
  • potpie/context-engine/src/potpie_context_engine/typed_serialization.py
  • potpie/context-engine/tests/conformance/test_graph_backend_conformance.py
  • potpie/context-engine/tests/conformance/test_graph_surface_lite_e2e.py
  • potpie/context-engine/tests/conformance/test_host_shell_end_to_end.py
  • potpie/context-engine/tests/conformance/test_internal_graph_runtime.py
  • potpie/context-engine/tests/conformance/test_local_profile_completion.py
  • potpie/context-engine/tests/conformance/test_nudge_e2e.py
  • potpie/context-engine/tests/core/test_agent_context_port.py
  • potpie/context-engine/tests/core/test_api_surface.py
  • potpie/context-engine/tests/core/test_context_events_scope.py
  • potpie/context-engine/tests/core/test_context_records.py
  • potpie/context-engine/tests/core/test_entity_canonicalization.py
  • potpie/context-engine/tests/core/test_event_playbooks.py
  • potpie/context-engine/tests/core/test_graph_definition.py
  • potpie/context-engine/tests/core/test_graph_plan_compatibility.py
  • potpie/context-engine/tests/core/test_graph_quality.py
  • potpie/context-engine/tests/core/test_graph_views.py
  • potpie/context-engine/tests/core/test_graph_workbench_ontology.py
  • potpie/context-engine/tests/core/test_identity.py
  • potpie/context-engine/tests/core/test_label_inference.py
  • potpie/context-engine/tests/core/test_library_isolation.py
  • potpie/context-engine/tests/core/test_ontology.py
  • potpie/context-engine/tests/core/test_ontology_classifier.py
  • potpie/context-engine/tests/core/test_ontology_lifecycle.py
  • potpie/context-engine/tests/core/test_reconciliation_config.py
  • potpie/context-engine/tests/core/test_reconciliation_issues.py
  • potpie/context-engine/tests/core/test_reconciliation_validation_edge_cases.py
  • potpie/context-engine/tests/core/test_record_types.py
  • potpie/context-engine/tests/core/test_semantic_mutation_validation.py
  • potpie/context-engine/tests/core/test_semantic_mutations.py
  • potpie/context-engine/tests/core/test_serialization.py
  • potpie/context-engine/tests/core/test_singleton_predicates.py
  • potpie/context-engine/tests/core/test_soft_downgrade.py
  • potpie/context-engine/tests/core/test_source_references.py
  • potpie/context-engine/tests/integration/test_e2e_http.py
  • potpie/context-engine/tests/integration/test_e2e_pipeline.py
  • potpie/context-engine/tests/integration/test_e2e_topology.py
  • potpie/context-engine/tests/integration/test_falkordb_roundtrip.py
  • potpie/context-engine/tests/integration/test_pydantic_deep_agent_run_batch.py
  • potpie/context-engine/tests/integration/test_sentry_defaults_build.py
  • potpie/context-engine/tests/unit/test_agent_execution_log.py
  • potpie/context-engine/tests/unit/test_agent_surface_contract.py
  • potpie/context-engine/tests/unit/test_backfill_seed.py
  • potpie/context-engine/tests/unit/test_context_aware_ingestion_agent.py
  • potpie/context-engine/tests/unit/test_context_engine_facade.py
  • potpie/context-engine/tests/unit/test_context_graph_query.py
  • potpie/context-engine/tests/unit/test_context_graph_writer.py
  • potpie/context-engine/tests/unit/test_deep_agent_containment.py
  • potpie/context-engine/tests/unit/test_envelope.py
  • potpie/context-engine/tests/unit/test_event_admission.py
  • potpie/context-engine/tests/unit/test_extras_smoke.py
  • potpie/context-engine/tests/unit/test_falkordb_analytics.py
  • potpie/context-engine/tests/unit/test_falkordb_backend.py
  • potpie/context-engine/tests/unit/test_falkordb_inspection.py
  • potpie/context-engine/tests/unit/test_falkordb_reader.py
  • potpie/context-engine/tests/unit/test_falkordb_writer.py
  • potpie/context-engine/tests/unit/test_graph_contract.py
  • potpie/context-engine/tests/unit/test_graph_surface_lite_contract.py
  • potpie/context-engine/tests/unit/test_graph_workbench_inbox.py
  • potpie/context-engine/tests/unit/test_graph_workbench_plans.py
  • potpie/context-engine/tests/unit/test_graph_workbench_quality.py
  • potpie/context-engine/tests/unit/test_ingestion_submission_service.py
  • potpie/context-engine/tests/unit/test_ledger_cursor_store.py
  • potpie/context-engine/tests/unit/test_mutation_apply_once.py
  • potpie/context-engine/tests/unit/test_neo4j_claim_query.py
  • potpie/context-engine/tests/unit/test_noop_agent.py
  • potpie/context-engine/tests/unit/test_nudge_service.py
  • potpie/context-engine/tests/unit/test_observability.py
  • potpie/context-engine/tests/unit/test_p9_readers.py
  • potpie/context-engine/tests/unit/test_policy_port.py
  • potpie/context-engine/tests/unit/test_potpie_context_api_client.py
  • potpie/context-engine/tests/unit/test_process_batch.py
  • potpie/context-engine/tests/unit/test_process_batch_chunking.py
  • potpie/context-engine/tests/unit/test_process_batch_streaming.py
  • potpie/context-engine/tests/unit/test_public_api.py
  • potpie/context-engine/tests/unit/test_pydantic_deep_agent_batch.py
  • potpie/context-engine/tests/unit/test_read_orchestrator.py
  • potpie/context-engine/tests/unit/test_reconciliation_factory.py
  • potpie/context-engine/tests/unit/test_repo_one_shot_ingestion_skill.py
  • potpie/context-engine/tests/unit/test_retrieval_eval.py
  • potpie/context-engine/tests/unit/test_sentry_metrics_container_init.py
  • potpie/context-engine/tests/unit/test_sentry_metrics_runtime.py
  • potpie/context-engine/tests/unit/test_sentry_metrics_runtime_attrs.py
  • potpie/context-engine/tests/unit/test_sentry_settings.py
  • potpie/context-engine/tests/unit/test_source_connector_registry.py
  • potpie/context-engine/tests/unit/test_submit_raw_episode.py
  • potpie/context-engine/tests/unit/test_timeline_endpoint.py
  • potpie/context-engine/tests/unit/test_windowed_admission.py
  • potpie/daemon/__main__.py
  • potpie/daemon/client.py
  • potpie/daemon/discovery.py
  • potpie/daemon/http/__init__.py
  • potpie/daemon/http/errors.py
  • potpie/daemon/http/transport.py
  • potpie/daemon/http/ui/__init__.py
  • potpie/daemon/http/ui/frontend/vite.config.ts
  • potpie/daemon/http/ui/router.py
  • potpie/daemon/lifecycle.py
  • potpie/daemon/main.py
  • potpie/daemon/managed_services/__init__.py
  • potpie/daemon/managed_services/container_backend.py
  • potpie/daemon/managed_services/external_backend.py
  • potpie/daemon/managed_services/subprocess_backend.py
  • potpie/daemon/ports/__init__.py
  • potpie/daemon/ports/operations.py
  • potpie/daemon/ports/service.py
  • potpie/daemon/ports/shell.py
  • potpie/daemon/process/__init__.py
  • potpie/daemon/process/ipc_client.py
  • potpie/daemon/process/launcher.py
  • potpie/daemon/process/pidfile.py
  • potpie/daemon/rpc.py
  • potpie/daemon/runtime/__init__.py
  • potpie/daemon/runtime/__main__.py
  • potpie/daemon/runtime/config.py
  • potpie/daemon/runtime/context.py
  • potpie/daemon/runtime/health.py
  • potpie/daemon/runtime/ipc_auth.py
  • potpie/daemon/runtime/registry.py
  • potpie/daemon/runtime/service_manager.py
  • potpie/daemon/runtime/shell.py
  • potpie/pots/__init__.py
  • potpie/pots/contracts.py
  • potpie/pots/local_service.py
  • potpie/pots/local_store.py
  • potpie/runtime/__init__.py
  • potpie/runtime/clients.py
  • potpie/runtime/codec.py
  • potpie/runtime/composition.py
  • potpie/runtime/controller.py
  • potpie/runtime/coordinator.py
  • potpie/runtime/env_bootstrap.py
  • potpie/runtime/local_engine.py
  • potpie/runtime/operations.py
  • potpie/runtime/ownership.py
  • potpie/runtime/protocol.py
  • potpie/runtime/resource_manager.py
  • potpie/runtime/root_services.py
  • potpie/runtime/sentry_settings.py
  • potpie/runtime/server.py
  • potpie/runtime/settings.py
  • potpie/runtime/transport.py
  • potpie/setup/__init__.py
  • potpie/setup/contracts.py
  • potpie/setup/flat_file_state.py
  • potpie/setup/installation.py
  • potpie/setup/local_installer.py
  • potpie/setup/orchestrator.py
  • potpie/setup/state.py
  • potpie/skills/__init__.py
  • potpie/skills/catalog.py
  • potpie/skills/contracts.py
  • potpie/skills/installer.py
  • potpie/skills/manager.py
  • potpie/skills/targets.py
  • pyproject.toml
  • results.md
  • scripts/context_engine_lab.py
  • scripts/typecheck_public_context_api.py
  • scripts/validate_conformance_history.py
  • scripts/verify_context_package_isolation.py
  • spec/changes/SPEC-CHANGE-0001-initialize-spec-process.md
  • spec/changes/SPEC-CHANGE-0002-initialize-glossary.md
  • spec/changes/SPEC-CHANGE-0003-initialize-product-contract.md
  • spec/changes/SPEC-CHANGE-0004-initialize-system-contract.md
  • spec/changes/SPEC-CHANGE-0005-initialize-context-engine-contract.md
  • spec/changes/SPEC-CHANGE-0006-initialize-resource-manager-contract.md
  • spec/changes/SPEC-CHANGE-0007-initialize-daemon-contract.md
  • spec/changes/SPEC-CHANGE-0008-initialize-cli-contract.md
  • spec/changes/SPEC-CHANGE-0009-correct-resource-manager-authentication-outcomes.md
  • spec/changes/SPEC-CHANGE-0010-initialize-potpie-capability-contract.md
  • spec/changes/SPEC-CHANGE-0011-stabilize-conformance-record-paths.md
  • spec/changes/SPEC-CHANGE-0012-restrict-daemon-signal-fallback.md
  • spec/conformance/cli.md
  • spec/conformance/context-engine.md
  • spec/conformance/cross-system.md
  • spec/conformance/daemon.md
  • spec/conformance/index.md
  • spec/conformance/potpie-capabilities.md
  • spec/conformance/potpie-resource-manager.md
  • spec/decisions/ADR-0001-spec-governance.md
  • spec/decisions/ADR-0002-single-importable-context-engine.md
  • spec/decisions/ADR-0003-explicit-composition-and-context-scoping.md
  • spec/decisions/ADR-0004-potpie-resource-management-ownership.md
  • spec/decisions/ADR-0005-typed-daemon-and-cli-boundary.md
  • spec/decisions/ADR-0006-deferred-runtime-concerns.md
  • spec/decisions/ADR-0007-context-runtime-migration-path.md
  • spec/decisions/ADR-0008-async-context-engine-public-contract.md
  • spec/decisions/ADR-0009-typed-local-runtime-execution-contract.md
  • spec/decisions/ADR-0010-resource-manager-authentication-outcomes.md
  • spec/decisions/ADR-0011-capability-oriented-potpie-layout.md
  • spec/decisions/ADR-0012-restrict-forceful-daemon-termination.md
  • spec/glossary.md
  • spec/index.md
  • spec/modules/README.md
  • spec/modules/cli.md
  • spec/modules/context-engine.md
  • spec/modules/daemon.md
  • spec/modules/potpie-capabilities.md
  • spec/modules/potpie-resource-manager.md
  • spec/process.md
  • spec/product.md
  • spec/questions/open.md
  • spec/system.md
  • tests/_auth_fakes.py
  • tests/characterization/test_cli_package_boundary.py
  • tests/characterization/test_context_runtime_architecture.py
  • tests/characterization/test_daemon_package_boundary.py
  • tests/characterization/test_potpie_capability_ownership.py
  • tests/characterization/test_product_process_surfaces.py
  • tests/conftest.py
  • tests/integration/test_canonical_daemon_runtime.py
  • tests/integration/test_cli_auth_atlassian_e2e.py
  • tests/integration/test_cli_auth_linear_e2e.py
  • tests/integration/test_context_runtime_contract.py
  • tests/integration/test_daemon_controller.py
  • tests/integration/test_daemon_external_backend.py
  • tests/integration/test_daemon_http_transport.py
  • tests/integration/test_daemon_http_transport_admin.py
  • tests/integration/test_daemon_http_transport_extra.py
  • tests/integration/test_daemon_http_transport_socket_edges.py
  • tests/integration/test_daemon_ipc_client.py
  • tests/integration/test_daemon_runtime_run.py
  • tests/integration/test_daemon_subprocess_backend.py
  • tests/integration/test_daemon_subprocess_backend_extra.py
  • tests/integration/test_distribution_defaults_build.py
  • tests/unit/test_agent_installer.py
  • tests/unit/test_agent_templates_v15.py
  • tests/unit/test_audit8_audit22.py
  • tests/unit/test_build_hook_config.py
  • tests/unit/test_bundle_catalog.py
  • tests/unit/test_cli_atlassian.py
  • tests/unit/test_cli_atlassian_shared.py
  • tests/unit/test_cli_bootstrap_status.py
  • tests/unit/test_cli_config.py
  • tests/unit/test_cli_daemon_service.py
  • tests/unit/test_cli_ergonomics.py
  • tests/unit/test_cli_gitlab.py
  • tests/unit/test_cli_gitlab_commands.py
  • tests/unit/test_cli_install_status.py
  • tests/unit/test_cli_linear.py
  • tests/unit/test_cli_linear_shared.py
  • tests/unit/test_context_resource_manager.py
  • tests/unit/test_credentials_store.py
  • tests/unit/test_daemon_config.py
  • tests/unit/test_daemon_container_backend.py
  • tests/unit/test_daemon_discovery.py
  • tests/unit/test_daemon_launcher.py
  • tests/unit/test_daemon_lifecycle_runtime.py
  • tests/unit/test_daemon_pidfile.py
  • tests/unit/test_daemon_pidfile_extra.py
  • tests/unit/test_daemon_rpc.py
  • tests/unit/test_daemon_seam.py
  • tests/unit/test_daemon_service_manager.py
  • tests/unit/test_empty_pot_guidance.py
  • tests/unit/test_env_bootstrap.py
  • tests/unit/test_gitbucket_cli.py
  • tests/unit/test_github_cli_auth.py
  • tests/unit/test_gitlab_client.py
  • tests/unit/test_graph_cli_contract.py
  • tests/unit/test_linear_read.py
  • tests/unit/test_linear_read_client.py
  • tests/unit/test_local_embedder_setup.py
  • tests/unit/test_local_engine.py
  • tests/unit/test_local_state_transactions.py
  • tests/unit/test_oauth_client_id_messages.py
  • tests/unit/test_onboarding_analytics.py
  • tests/unit/test_operation_coordinator.py
  • tests/unit/test_pot_create_repo.py
  • tests/unit/test_potpie_api_config.py
  • tests/unit/test_potpie_auth_helpers.py
  • tests/unit/test_product_analytics.py
  • tests/unit/test_read_presenter.py
  • tests/unit/test_repo_baseline_skill.py
  • tests/unit/test_root_services.py
  • tests/unit/test_runtime_clients.py
  • tests/unit/test_runtime_composition.py
  • tests/unit/test_runtime_ownership.py
  • tests/unit/test_runtime_protocol_codec.py
  • tests/unit/test_runtime_settings.py
  • tests/unit/test_runtime_transport.py
  • tests/unit/test_sentry_auth.py
  • tests/unit/test_sentry_cli.py
  • tests/unit/test_sentry_daemon.py
  • tests/unit/test_setup_agent_skills.py
  • tests/unit/test_setup_defer_pot.py
  • tests/unit/test_setup_defer_skills.py
  • tests/unit/test_setup_first_pot.py
  • tests/unit/test_setup_live_ux.py
  • tests/unit/test_skill_manager_global_targets.py
  • tests/unit/test_skills_cli.py
  • tests/unit/test_source_cli_contract.py
  • tests/unit/test_telemetry_cli.py
  • tests/unit/test_telemetry_settings.py
  • tests/unit/test_ui_router.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b692611ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread potpie/runtime/composition.py
Comment thread potpie/runtime/root_services.py
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Dsantra92

Copy link
Copy Markdown
Member Author

Authentication scope follow-up remains intentionally separate from this remediation. OQ-AUTH-MODEL-001 is tracked in spec/questions/open.md and covers local IPC, Potpie login, hosted clients, integrations, and browser access as distinct trust boundaries. This PR keeps the bearer credential documented as transitional daemon authentication; it does not expose that bearer to browser JavaScript or claim browser/UI authentication is solved.

@Dsantra92

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ASCE-D

ASCE-D commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Two follow-up findings (low severity, but they conflict with accepted spec behaviors)

5. _pid_alive treats PermissionError as "dead", enabling record deletion of a live cross-user daemon (potpie/daemon/lifecycle.py:70-71)

On a shared machine, os.kill(pid, 0) against a daemon owned by another user raises PermissionError, which _pid_alive currently maps to dead (same bucket as ProcessLookupError). status()/start() then proceed to _cleanup_runtime_records, orphaning a running daemon.

PID liveness probing itself is unspecified in the contract, but this runs against two accepted behaviors: DAEMON-055 (artifacts may only be removed while holding the runtime ownership lock) and DAEMON-056 (spec/modules/daemon.md:382 — cleanup "MUST remove canonical runtime artifacts only when the discovery document matches both the exact expected PID and the exact expected per-boot daemon instance identity"). A live-but-permission-denied daemon will still satisfy those exact-match conditions, so deleting its records is precisely the case those behaviors are meant to prevent. Treating PermissionError as alive (or gating cleanup on a successful identity match against a readable discovery doc) closes it. The zombie-reaping improvement via waitpid in the remediation commits is nice, but doesn't cover this path.

7. graph describe without --subgraph yields a generic protocol 400 instead of a typed validation failure (potpie/cli/commands/graph.py:1396-1410)

subgraph: str = typer.Argument(None) flows straight into DescribeRequest(subgraph=None); the strict codec rejects the non-string (typed_serialization.py:139-141), so daemon mode surfaces operation_payload_malformed — a transport-envelope error — for what is actually a local input-validation miss. In-process mode produces the intended "subgraph is required" message via _required_value, so the two execution modes diverge.

This doesn't match either accepted error category: CLI failure summary (spec/modules/cli.md:264) says "Local parse or input failure → PresentationError without dispatch", and CE-029 (spec/modules/context-engine.md:204) maps domain input rejection to DomainError. The malformed-envelope failure is scoped by ADR-0009 to envelopes that "cannot supply a valid request identity" — a different case. Cheapest fix: validate/default subgraph CLI-side before dispatch (e.g. require the argument or pass "" and let the engine return the DomainError), which also keeps local/daemon parity.

(Findings 4 — port-selection TOCTOU — and 6 — .env loading semantics — remain open as unspecified spec gaps; happy to file those separately if useful.)

@Dsantra92

Copy link
Copy Markdown
Member Author

Thanks @ASCE-D. Both follow-ups are addressed in b99ad4d.

For _pid_alive, PermissionError is now treated as proof that the process exists, so status/start fail closed instead of treating a permission-denied PID as stale. A regression test covers the non-child EPERM path.

For graph describe, a missing subgraph is now rejected locally as validation_error before the engine client is obtained or any request is dispatched. A regression test asserts the error envelope and zero dispatch.

Verification:

  • focused daemon/CLI/runtime lane: 145 passed
  • executable Context Engine conformance suite: 54 passed
  • full root lane: 1449 passed, 4 skipped, 1 deselected
  • spec validation: 0 warnings
  • stable conformance-history validation: 6 records, 195 behaviors, history resolved
  • changed-file pre-commit hooks: passed

@ASCE-D ASCE-D left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. My earlier findings are resolved and verified on the latest head: #2/#3 fixed in e301c9c (resolved pot_id now dispatched as an explicit selector; snapshot paths absolutized CLI-side), #5/#7 fixed in b99ad4d (PermissionError treated as alive in _pid_alive; CLI-side subgraph validation fails without dispatch). Targeted test suites pass locally (81 tests). The unauthenticated loopback UI API is intentionally deferred per the author; the port-selection TOCTOU and .env-loading semantics remain as unspecified spec gaps worth an OQ entry or follow-up issue.

@Dsantra92
Dsantra92 merged commit 217e51c into main Aug 28, 2026
19 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b99ad4d153

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +257 to +258
write_daemon_pid(self.home, outcome.value.pid)
write_daemon_discovery(self.home, discovery)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish daemon identity before reporting readiness

If the parent CLI is killed after the authenticated readiness handshake but before these writes, the child remains live while holding daemon.runtime.lock, but only its credential exists: status reports it as down, stop has no PID to authenticate, and a subsequent start is rejected because the live child owns the lock. Fresh evidence after the claimed fix is that the child callback in potpie/daemon/__main__.py still writes only the credential, while PID and discovery publication remains parent-owned here; publish the complete identity from the lock-owning child before readiness.

Useful? React with 👍 / 👎.

Comment on lines +512 to +518
try:
engine_outcome = await self._engine_factory(
context=context,
config=composition.config,
dependencies=composition.dependencies,
)
except Exception as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clean up composed resources when acquisition is cancelled

If an acquisition task is cancelled while the engine factory is awaiting, asyncio.CancelledError bypasses this except Exception block after compose() has already returned its host resources. The engine is never cached, so manager shutdown cannot discover or release those connections or handles; cancellation should run the failed-acquisition cleanup before being propagated.

Useful? React with 👍 / 👎.

Comment thread potpie/runtime/clients.py
Comment on lines +912 to +914
validation_error = response_validation_error(request, response)
if validation_error is not None:
return Failure(validation_error)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve unknown mutation outcomes on correlation failures

When a mutating request has executed but its otherwise valid response carries a mismatched request ID or protocol version, this returns a plain ProtocolError with no dispatched or unknown-outcome marker. Callers therefore cannot distinguish the response defect from a pre-dispatch failure and may retry an already-applied mutation; correlation validation failures for dispatched mutations need the same unknown-outcome treatment as schema-invalid responses.

Useful? React with 👍 / 👎.

Comment on lines +829 to +832
async def _call(self, call: Callable[[], object]) -> Outcome[object]:
try:
return Success(await asyncio.to_thread(call))
except CapabilityNotImplemented as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hold coordination until cancelled worker threads finish

If a local or daemon operation is cancelled while this to_thread call is executing, cancellation stops the await but does not stop the synchronous backend function. The handler then unwinds the coordinator context and releases its lease while the worker can still be mutating the graph, so a subsequent same-context operation or shutdown can run concurrently with it; shield the worker and wait for its completion before propagating cancellation.

Useful? React with 👍 / 👎.

Comment on lines +140 to +145
def get_runtime():
"""Return the process-wide explicit runtime composition, built lazily."""
if _state["runtime"] is None:
from potpie.runtime.composition import build_local_runtime

_state["runtime"] = build_local_runtime()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Build root services without requiring graph composition

Root-owned commands such as config list, config set, and pot/source administration now reach this full build_local_runtime() call through get_root_runtime(), even in daemon mode. If the CLI environment selects an invalid or unavailable graph backend while an existing daemon was started with a working profile, these metadata and recovery commands fail during local backend construction before reaching their independent services; compose the root capability group without constructing the graph runtime.

Useful? React with 👍 / 👎.

Comment on lines +119 to +120
)
if spec.safety is SafetyClass.SHARED_CONTEXT_READ_EXCLUSIVE_RESOURCE_WRITE:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Serialize shared in-memory mutations across contexts

With the supported in_memory backend, different pots still share one InMemoryClaimQueryStore, but every mutation receives only its per-context write lock here. Concurrent operations on different pots can therefore race on the same lists and indexes; for example, reset_pot() replaces store.rows while a mutation for another pot appends to the previous list, losing the latter update. Give this backend a shared resource lock or make its store operations internally synchronized while retaining concurrency for backends that support it.

Useful? React with 👍 / 👎.

ASCE-D added a commit that referenced this pull request Aug 31, 2026
…ntime

Main's #1057 dissolved potpie-context-core into potpie_context_engine.core
and replaced HostShell with LocalRuntimeComposition. This merge re-homes the
document-ingestion feature accordingly:

- resource contracts + ports moved to potpie_context_engine/core/ (imports
  rewritten repo-wide; the potpie-context-core package is gone)
- ResourceService is wired into LocalEngineServices.resources by
  build_local_runtime, chunk_search wiring preserved; document/resource CLI
  commands use get_runtime()/get_root_runtime() instead of HostShell
- removed an accidental nested duplicate of the potpie-document-ingestion
  skill (potpie-document-ingestion/potpie-document-ingestion/) that had been
  failing the snippet linter; updated the skill's SKILL.md/examples.md/
  reference.md and claude_bundle/CLAUDE.md for main's template rules
  (potpie ingest and context_record are gone -> potpie record)
- characterization pins extended deliberately: LocalEngineServices gains
  'resources'; CLI surface gains 'document' and 'resource'; skill catalog
  gains potpie-document-ingestion

Root suite: 1474 passed, 0 failed. Engine suite: 1224 passed; 3 pre-existing
failures (docling fixture x2, pdf_docling patch-target drift). CLI verified
end-to-end: ingest, search, show, agent-path resource import, list, rm.
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.

2 participants