Skip to content

feat(zotero): connect approved execution boundary - #19

Draft
seonghobae wants to merge 14 commits into
autoresearch/zotero10-local-authorizationfrom
autoresearch/zotero10-approved-execution
Draft

feat(zotero): connect approved execution boundary#19
seonghobae wants to merge 14 commits into
autoresearch/zotero10-local-authorizationfrom
autoresearch/zotero10-approved-execution

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Verified local approval-order repair — 2026-09-06 checkpoint

Exact head: autoresearch/zotero10-approved-execution@de9df48d727fe22a3f1efb881d7d17ef0566b620. Exact base: autoresearch/zotero10-local-authorization@5e33981ccb0691e0a24260652c44fe8e28afb8d9.

Original planner owner #13 preserves regression 505e111c993d8269e5b7b9e17a25a5ce20f8606e and repair 8a684882005085d8b3cb47812e185975084e0475. Every existing local request/mode/item/metadata check finishes before the external approval verifier. Invalid requests invoke it zero times; valid complete requests invoke it exactly once. Local validation errors intentionally precede approval denial. Deterministic operations and complete before/after/rollback metadata are unchanged.

This exact head passed locked Rust 1.98.0 workspace tests (106 tests / 20 unfiltered suites, doctests included), strict all-target Clippy, formatting, warnings-denied rustdoc, CI contract and diff checks before normal push. Normal parent integration retains both the prior child and verified parent as ancestors. Coverage from another stack head is not attributed to this head.

Keep Draft behind the existing prerequisite stack. This is local verification, not hosted current-head GREEN, independent approval, protected merge or release. No later full-text feature was reverse-merged into an earlier owner. Full-text-aware write admission, authentic decisions and independent authority remain separate gaps; no real Zotero/model request, label, approval or write was performed for this repair.

Earlier coordinates and status claims below are historical.

Prior PR description, retained without discarding evidence

Current source-integrity note — 2026-09-05

  • Exact head: autoresearch/zotero10-approved-execution@9dc1387a588a3ecfe2be255f68467be68a9fc591.
  • Exact base: autoresearch/zotero10-local-authorization@1105f4f12ebf37fb98d9d52ba44078c765ed86eb.
  • This head inherits PR feat(research): add steward golden-set evaluation #10 root e7d4e59f1b55b5954c5f8436527bc96e7ef2fb13 through ordinary merge ancestry. The source-snapshot digest binds complete captured raw provider JSON and the actual typed classifier inputs; source evidence and derived proposals retain separate identities.
  • GoldenSetApproval.proposal_digest is required and binds the complete proposal records used for evaluation. The current proposal digest is checked before the caller-owned governance verifier. Do not backfill old receipts: regenerate evidence and obtain a new approval bound to the reviewed evidence.
  • Keep Draft. This note does not claim current exact-head hosted GREEN, independent approval, protected merge, live Zotero mutation, or governed publication. Root, predecessor, and terminal-stack local test evidence is not transferred as per-PR hosted evidence.

Earlier heads, runtime snapshots, campaign counts, and verification statements below are historical notes, not current acceptance evidence.

Historical PR notes — original text retained

Outcome

Connect one user-authorized/server-bound Zotero 10 adapter to the existing reviewed-plan execution core without creating a second mutation implementation. The slice preserves dry-run, complete preflight, same-boundary reconciliation, and reverse rollback receipts, with one end-to-end mock Local API path covering preflight -> write -> receipt coordinates.

Current exact stack — 2026-09-05

Inherited gates that this PR does not erase

The mock adapter path proves orchestration mechanics only. It cannot turn predecessor source repairs into exact-head GREEN.

Security/product boundary

Zotero's Local API uses http://localhost:23119/api/; Zotero-Server-ID is a database continuity/precondition coordinate, not cryptographic peer authentication. Until product security explicitly accepts hostile same-host observation/interposition as out of scope or Zotero provides authenticated encrypted/equivalent IPC, this path must not be advertised or released as enterprise-secure live write-back.

No key may enter repository fixtures, logs, receipts, serializable domain artifacts, semantic evidence, or model prompts. No live Zotero mutation is claimed.

Dependency and merge gate

Keep Draft behind #18 -> #17 -> #16 -> #15 -> #13 -> #12 -> #11 -> #10 -> #9 -> Foundation. Later transport/integration tests never substitute for exact-head predecessor review, Product, security, coverage, or governance evidence. Require all predecessor gates and any #19-local finding to reach one unchanged exact-head GREEN with protected review/security/dependency checks terminal. No self-approval, routine administrator bypass, force-push, destructive rebase, secret persistence, provider-security overclaim, or live mutation without approved rollback evidence.

Refs #8.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@codex review\n\nPlease review exact head 11d1eec178bad6b09a4163cddd0bf165728c8a94 and its parent-bound execution contract.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review\n\nPlease review exact head 11d1eec178bad6b09a4163cddd0bf165728c8a94, focusing on preservation of dry-run, full preflight, server binding, reconciliation, rollback receipts, single-use key behavior, and secret safety.

@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.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='11d1eec178bad6b09a4163cddd0bf165728c8a94'
parent='cf1832461c0b22e92afc3fe671c977964bf06ac4'

printf '%s\n' '=== commit verification ==='
git rev-parse HEAD
git rev-parse "${head}^{parent}"
git cat-file -t "$head"
git cat-file -t "$parent"
git merge-base --is-ancestor "$parent" "$head" && echo "specified parent is an ancestor"
git diff-tree --no-commit-id --name-status -r "$parent" "$head"

printf '%s\n' '=== diff stat ==='
git diff --stat "$parent" "$head"

printf '%s\n' '=== changed Rust outlines ==='
git diff --name-only "$parent" "$head" -- '*.rs' |
while IFS= read -r file; do
  [ -n "$file" ] || continue
  printf '\n--- %s ---\n' "$file"
  ast-grep outline "$file" --items all --view expanded || true
done

printf '%s\n' '=== focused symbols and safety-related references ==='
rg -n -i -C 3 \
  '(dry.run|preflight|reconcil|rollback|receipt|api.?key|authorization|bearer|secret|token|localhost|127\.0\.0\.1|base.?url|server|request|response|delete|create|update)' \
  $(git diff --name-only "$parent" "$head" -- '*.rs' '*.md' '*.toml') || true

printf '%s\n' '=== exact source diff ==='
git diff --find-renames --find-copies --unified=80 "$parent" "$head" -- '*.rs' '*.toml'

Length of output: 1882


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/ConceptWeave'
head='11d1eec178bad6b09a4163cddd0bf165728c8a94'
parent='cf1832461c0b22e92afc3fe671c977964bf06ac4'

printf '%s\n' '=== immutable commit metadata ==='
gh api "repos/${repo}/commits/${head}" \
  --jq '{sha, parents: [.parents[].sha], message: .commit.message, files: [.files[] | {filename, status, additions, deletions, patch}]}'

printf '%s\n' '=== exact parent-to-head comparison ==='
gh api "repos/${repo}/compare/${parent}...${head}" \
  --jq '{status, ahead_by, behind_by, merge_base_commit: .merge_base_commit.sha, commits: [.commits[] | .sha], files: [.files[] | {filename, status, additions, deletions, previous_filename, patch}]}'

Length of output: 32800


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='crates/conceptweave-zotero/src/lib.rs'

printf '%s\n' '=== source map ==='
ast-grep outline "$file" --items all --view expanded

printf '%s\n' '=== production definitions and relevant call sites ==='
rg -n -C 4 \
  '^(pub )?(fn|struct|enum|impl)\s+(execute_classification_write_plan|execute_classification_write_plan_with_zotero10|Zotero10LocalAdapter|Zotero10Authorization|Zotero10|.*Key)|\b(get_item|write_item|authorize|into_adapter|into_zotero|Authorization)\s*\(' \
  "$file"

printf '%s\n' '=== safety-sensitive implementation references ==='
rg -n -i -C 5 \
  '(derive\(|Debug|Display|Serialize|Deserialize|api.?key|authorization|bearer|zotero-server-id|server.?id|authorization|header|redirect|timeout|dry.run|preflight|reconcil|rollback|receipt|write.?item|get.?item)' \
  "$file"

printf '%s\n' '=== source slices around each relevant definition ==='
for line in $(rg -n \
  '^(pub )?fn execute_classification_write_plan|^(pub )?fn execute_classification_write_plan_with_zotero10|^(pub )?struct Zotero10LocalAdapter|^(pub )?struct Zotero10Authorization|^impl Zotero10LocalAdapter|^impl Zotero10Authorization|^mod tests' \
  "$file" | cut -d: -f1); do
  start=$(( line > 45 ? line - 45 : 1 ))
  end=$(( line + 220 ))
  printf '\n--- lines %s-%s ---\n' "$start" "$end"
  sed -n "${start},${end}p" "$file"
done

Length of output: 174434


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='crates/conceptweave-zotero/src/lib.rs'

printf '%s\n' '=== locally available exact head range ==='
git rev-parse HEAD
git rev-parse HEAD^
git diff --check HEAD^ HEAD
git diff --name-status HEAD^ HEAD
git diff --unified=35 HEAD^ HEAD -- "$file"

printf '%s\n' '=== execution-core tests ==='
rg -n -C 6 \
  '^\s*fn .*?(dry_run|preflight|reconcil|rollback|partial_failure|write_plan|execute).*?\(' \
  "$file"

printf '%s\n' '=== direct execution-core invocations in tests ==='
rg -n -C 8 \
  '\bexecute_classification_write_plan(_with_zotero10)?\s*\(' \
  "$file"

printf '%s\n' '=== secret-bearing types and formatting / serialization implementations ==='
rg -n -C 3 \
  'impl\s+(fmt::Debug|fmt::Display|Serialize|Deserialize)\s+for\s+(Zotero10LocalAuthorization|Zotero10LocalAdapter)|derive\([^)]*(Debug|Serialize)[^)]*\).*?(Zotero10LocalAuthorization|Zotero10LocalAdapter)|api_key' \
  "$file"

Length of output: 11865


@seonghobae Reviewed exact head 11d1eec178bad6b09a4163cddd0bf165728c8a94 against parent cf1832461c0b22e92afc3fe671c977964bf06ac4.

No actionable findings.

The new public boundary delegates directly to execute_classification_write_plan. It does not add a second mutation implementation.

The delegation preserves these behaviors:

  • Dry-run returns before either adapter closure runs.
  • The core completes all item preflight reads before the first write.
  • Reconciliation reuses adapter.get_item through the same adapter boundary.
  • Receipts contain rollback coordinates only for verified applied states.
  • Rollback operations remain reverse ordered.
  • The adapter verifies Zotero-Server-ID on read and write responses.
  • The authorization wrapper is consumed by into_adapter(self).
  • The key remains private. The authorization wrapper and adapter do not implement Debug or Serialize.

The added mock Local API test verifies the expected three preflight requests, one verified write, and the post-write rollback revision. git diff --check reported no whitespace errors.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Non-force restack PR #19 onto PR #18 current head. Preserve approved-execution orchestration while carrying the current predecessor receipt RED contracts and transport-security boundary through ancestry; no predecessor GREEN is claimed.
seonghobae added a commit that referenced this pull request Sep 4, 2026
Non-force restack PR #20 onto PR #19 current head. Preserve rollback semantics while carrying PR #15's current receipt/execution RED contracts and inherited transport-security boundary through ancestry; no predecessor GREEN is claimed.
Non-force two-parent restack onto current authorization parent. Preserve the approved-execution integration while inheriting the repaired Foundation CI, receipt, and transport lineage.

Signed-off-by: Seongho Bae <me@seonghobae.me>

Copy link
Copy Markdown
Contributor Author

Current-stack correction (2026-09-05): exact base #18 6f0cfdb153babc77e87d5a21bb59672a09190ec7; exact head 48f9e7ce743cfa05ac3fba044e769fc64e0ad4fc. Approved-execution integration is preserved by non-force restack; inherited receipt and provider-security gates remain authoritative.

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