Skip to content

refactor(daemon-service): own source access instead of injecting it - #1186

Merged
ScriptedAlchemy merged 6 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
fix/daemon-service-source-access-owner
Sep 10, 2026
Merged

refactor(daemon-service): own source access instead of injecting it#1186
ScriptedAlchemy merged 6 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
fix/daemon-service-source-access-owner

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Fixes three defects introduced by #1178 and #1175, found in independent review.

  • refactor(daemon-service): own source access instead of injecting itrefactor(daemon-service): move query authz and remote protocol #1178 added a single-implementation injected closure impl Fn(&ResolvedScope, &Path, &PinnedRuntimeConfiguration, UtcMicros) -> Result<ProjectSourceAccessSnapshot, _> to DaemonCallableCodeAuthorizationSource::production and DaemonCodeGraphReadAdmission::production purely so relocated code could call back into root (the class refactor(workspace): drop one-impl pass-through ports outside root #1174 was deleting). daemon_owned_project_source_access_at, project_open_source_access_authority, DAEMON_REQUESTER and GRANT_HORIZON now live in tracedecay-daemon-service::callable_code_authorization — one definition each, root copies deleted — and the parameter is gone from both constructors. Semantics byte-identical (actor actor.tracedecay-daemon.project-open, project_owner_capabilities(), 24h horizon, same Inconsistent { field: "project-open requester" } mapping). Eight callers import from daemon-service directly; no root re-export.
  • test(daemon-service): move remote observation coverage to ownerremote_query_result_observation had been widened to unconditional pub (plus pub mod remote_protocol) so two root tests could reach it. The two tests move into daemon-service (same names, same assertions); the function is pub(super) again and the module is private.
  • refactor(graph-query): keep the admitted query port test-onlyadmitted_verified_graph_query_port was #[cfg(test)] in root before refactor(root): contract the TraceDecay facade onto owner crates #1175 and became unconditional pub in tracedecay-graph-query; it is now #[cfg(any(test, feature = "test-helpers"))] (its only caller is root's cfg(test) dispatch test support). Plain cargo check -p tracedecay-graph-query no longer exports it.

Verification: clippy -D warnings --tests on daemon-service/graph-query/root; daemon-service 258 (incl. the two moved observation tests); root daemon::project_open_owners 13 incl. git_catalog_tests; invocation_tests::types_tests 15; graph-query 55; fmt; commitlint. Two independent Opus passes; second pass's items (duplicated constants, test-only forwarding wrapper) fixed and folded.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4a57b9e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T00:49:04.911018Z c83651e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedfix/daemon-service-source-access-owner

Total Elapsed Time: 3.87s → 3.69s (-4.7%)
CPU Baseline: 245.71µs → 246.71µs (+0.4%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                            | P95                             | Total                           | % Total                      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 3.87s → 3.69s (-4.7%)          | 3.87s → 3.69s (-4.7%)           | 3.87s → 3.69s (-4.7%)           | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 124.13ms → 113.00ms (-9.0%)    | 186.12ms → 155.19ms (-16.6%)    | 1.61s → 1.47s (-8.7%)           | 41.72% → 39.84% (-4.5%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 15.24ms → 14.14ms (-7.2%)      | 52.79ms → 51.18ms (-3.0%)       | 1.26s → 1.17s (-7.1%)           | 32.69% → 31.83% (-2.6%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| domain.canonical.sha256                  | 110414 → 110414 (+0.0%)    | 9.35µs → 9.29µs (-0.6%)        | 12.86µs → 12.73µs (-1.0%)       | 1.03s → 1.03s (+0.0%)           | 26.68% → 27.83% (+4.3%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 443.63ms → 439.68ms (-0.9%)    | 513.54ms → 505.15ms (-1.6%)     | 887.26ms → 879.36ms (-0.9%)     | 22.94% → 23.85% (+4.0%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 62.59ms → 59.69ms (-4.6%)      | 88.01ms → 81.13ms (-7.8%)       | 813.71ms → 775.96ms (-4.6%)     | 21.04% → 21.04% (+0.0%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 54.77ms → 52.54ms (-4.1%)      | 79.04ms → 72.16ms (-8.7%)       | 712.00ms → 683.06ms (-4.1%)     | 18.41% → 18.52% (+0.6%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.21ms → 2.16ms (-2.3%)        | 3.25ms → 3.21ms (-1.2%)         | 609.08ms → 595.99ms (-2.1%)     | 15.75% → 16.16% (+2.6%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 51.63ms → 44.77ms (-13.3%)     | 81.26ms → 63.83ms (-21.4%) 🚀   | 671.19ms → 582.00ms (-13.3%)    | 17.35% → 15.78% (-9.0%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 2.02ms → 1.98ms (-2.0%)        | 3.04ms → 2.96ms (-2.6%)         | 556.31ms → 546.40ms (-1.8%)     | 14.38% → 14.82% (+3.1%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 37.72ms → 36.14ms (-4.2%)      | 229.38ms → 223.08ms (-2.7%)     | 528.01ms → 505.93ms (-4.2%)     | 13.65% → 13.72% (+0.5%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 42.84ms → 36.61ms (-14.5%)     | 70.52ms → 52.56ms (-25.5%) 🚀   | 556.86ms → 475.88ms (-14.5%)    | 14.40% → 12.91% (-10.3%)     |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.build.assemble                | 2 → 2 (+0.0%)              | 194.86ms → 194.39ms (-0.2%)    | 204.08ms → 205.00ms (+0.5%)     | 389.73ms → 388.78ms (-0.2%)     | 10.08% → 10.54% (+4.6%)      |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.postings.ngram_rows | 13 → 13 (+0.0%)            | 29.44ms → 29.11ms (-1.1%)      | 40.01ms → 40.14ms (+0.3%)       | 382.69ms → 378.38ms (-1.1%)     | 9.89% → 10.26% (+3.7%)       |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.chunk.build                   | 276 → 276 (+0.0%)          | 1.39ms → 1.36ms (-2.2%)        | 1.96ms → 1.99ms (+1.5%)         | 384.71ms → 374.34ms (-2.7%)     | 9.95% → 10.15% (+2.0%)       |
+------------------------------------------+----------------------------+--------------------------------+---------------------------------+---------------------------------+------------------------------+

Generated with hotpath-rs

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.

1 participant