Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "dk-workflows",
"source": "./",
"description": "dk-workflows",
"version": "1.2.0"
"version": "1.2.1"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dk-workflows",
"version": "1.2.0",
"version": "1.2.1",
"description": "Portable repository workflows, configurable reviewers, and guarded drafting.",
"author": {
"name": "Dmitry Kropachev"
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dk-workflows",
"version": "1.2.0",
"version": "1.2.1",
"description": "Portable repository workflows, configurable reviewers, and guarded drafting.",
"author": {
"name": "Dmitry Kropachev"
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dk-workflows

Independent MIT plugin for Claude Code and Codex. Version 1.2.0.
Independent MIT plugin for Claude Code and Codex. Version 1.2.1.

## Install

Expand Down Expand Up @@ -113,6 +113,16 @@ plugin inventory within each command invocation. A later invocation reads the
registry again; selected manifests and skill files are still checked on each
resolution. This inventory reuse never supplies cached review findings.

Tree-preserving iteration cleanup requires `run-state precheck-cleanup` before a
regroup push or no-op assessment. Its immutable receipt binds the candidate and
remote lease to the original review and current preparation; it cannot authorize
completion. After publication, refresh final-head preparation, reconcile directly
against the original review, and verify engineering criteria and exact-head CI.
Version-2 attestations can retain coverage for source-verified discussion
restatements and operational wording with unchanged engineering meaning. They
preserve raw fingerprints, immutable results, reviewer packages and cycle budgets.
Material or ambiguous changes remain blocking, including after cycle five.

Known GitHub read operations retry transient connection and HTTP 5xx failures
at most three times, with jitter and one shared deadline per read (60 seconds
unless the caller supplies a shorter timeout). Authentication, schema failures,
Expand Down
27 changes: 27 additions & 0 deletions runtime/dk-pr-decisions/references/preparation.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,30 @@ clean reviews cannot replace these assessments. Both stages receive
`--preparation-file`, `--verification-file` and `--run-record`; the current mutable
record must match active preparation and choices. Refresh verification after relevant
changes, preserving earlier versions. Custom completion prompts cannot bypass gates.

### Coverage across discussion restatements and cleanup

Before cleanup publication, refresh complete feedback, verified Decisions and
preparation on an isolated checkout of the still-published reviewed head. Run
`run-state precheck-cleanup --head REVIEWED_SHA --candidate-head CANDIDATE_SHA
--split-state FILE` and retain its immutable receipt. Added discussion Decisions
can preserve coverage only when every addition maps independently to an original
decision or prepared boundary and cites both retained original evidence and the
verified discussion bodies. Changed human choices, removals, supersessions, new
obligations and ambiguity block coverage. Assess every analysis field and changed
source, including worker instructions and completion criteria. A choice source
may use these rules and change its head only if it exactly copies that
preparation's validated Decisions context. Other choice, issue, instruction,
rule and reviewer inputs remain strict; raw hashes and original artifacts remain
unchanged. Version-1 attestations retain their original restrictions.

Valid version-1 review results may authorize a precheck only at their exact
reviewed scope, using their original run/cycle provenance and strict version-1
comparison. Do not invent a session or attempt. This does not relax final
coverage or permit version-2 reconciliation of a version-1 review result.

The precheck cannot authorize completion. Refresh final-head evidence after
cleanup. For version-2 review provenance, reconcile directly against the original
reviewed preparation using the published assessment; version-1 coverage keeps
its exact-scope verification. Refresh engineering verification and require
exact-head CI. Preserve the existing run, cycle count and five-cycle limit.
14 changes: 8 additions & 6 deletions runtime/dk-pr-decisions/scripts/decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
sys.path.insert(0, str(next(p for p in Path(__file__).resolve().parents if (p / 'shared').is_dir())))
import argparse
import base64
from shared.pr_identity import resolve as resolve_pr_identity
from shared.executors import check_prompt_size, execute, execute_json, provider_failure
from shared.repository_scope import inside_checkout
import hashlib
Expand Down Expand Up @@ -531,7 +532,7 @@ def scan(pr_target=None):
repo_dir = Path.cwd()
try:
pr = gh_json(["pr", "view", *([str(pr_target)] if pr_target else []), "--json",
"number,title,body,url,headRefOid,headRepository,baseRefOid,baseRefName,changedFiles"])
"number,title,body,url,headRefOid,headRefName,headRepository,isCrossRepository,baseRefOid,baseRefName,changedFiles"])
except RuntimeError as exc:
if "no pull requests found" in str(exc).lower() or "no pull request found" in str(exc).lower():
raise RuntimeError("No pull request found for the current branch") from exc
Expand Down Expand Up @@ -593,8 +594,9 @@ def scan(pr_target=None):
diff = pr_diff(pr)
context = {"pr": pr, "diff": diff, "linked_issues": linked_issues(pr.get("body") or "", owner, name, host,
pr["number"])}
head_repo = (pr.get("headRepository") or {}).get("nameWithOwner") or f"{owner}/{name}"
links = code_links(diff, f"{url.scheme}://{host}/{head_repo}", pr["headRefOid"])
_, base_repo, head_repo = resolve_pr_identity(pr, repo_dir, api=lambda *args: gh_json(list(args)),
allow_unavailable_head=True)
links = code_links(diff, f"{url.scheme}://{host}/{head_repo or base_repo}", pr["headRefOid"])
status_changed = any(tid in old_threads and old_threads[tid]["resolved"] != thread["resolved"]
for tid, thread in threads.items())
context_changed = bool(prior) and (prior.get("pr", {}).get("body") != pr.get("body")
Expand Down Expand Up @@ -847,10 +849,10 @@ def suggest_from_code(state, path):
if previous.get('head') == head:
return previous['items']
pr = state['pr']
parts = urlparse(pr['url']).path.strip('/').split('/')
diff = pr_diff(pr)
head_repo = (pr.get('headRepository') or {}).get('nameWithOwner') or '/'.join(parts[:2])
links = code_links(diff, f"{urlparse(pr['url']).scheme}://{urlparse(pr['url']).hostname}/{head_repo}", head)
_, base_repo, head_repo = resolve_pr_identity(pr, Path.cwd(), api=lambda *args: gh_json(list(args)),
allow_unavailable_head=True)
links = code_links(diff, f"{urlparse(pr['url']).scheme}://{urlparse(pr['url']).hostname}/{head_repo or base_repo}", head)
# Keep complete evidence outside the request, including after a provider failure.
# A unique directory prevents concurrent discoveries from replacing each other's inputs.
evidence_dir = Path(tempfile.mkdtemp(prefix='code-evidence-', dir=Path(path).resolve().parent))
Expand Down
Loading
Loading