Skip to content

docs(governance): add the orchestration governance proposal and merge plan - #375

Merged
KooshaPari merged 7 commits into
masterfrom
docs/orchestration-governance-docs-only
Nov 28, 2026
Merged

KooshaPari merged 7 commits into
masterfrom
docs/orchestration-governance-docs-only

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

User description

Salvage

This branch was found during the 2026-11-27 branch-retirement pass and is
not contained in master. It is opened here so the work is reviewable and
does not silently rot as a remote ref.

Evidence it is not redundant (all three must hold; see
host-ops/kcode-branch-retirement):

  • git merge-tree --write-tree origin/master origin/docs/orchestration-governance-docs-only produces a tree that
    differs from origin/master (so merging it changes master).
  • The branch's blobs do not all appear anywhere in origin/master's history
    of the paths it touches.
  • No open PR already covers it.

Size: 3 file(s), 3 files changed, 966 insertions(+).

Review this as a normal contribution. It is not auto-merged, and the branch is
kept until someone decides.

Recovery/identity: the branch is docs/orchestration-governance-docs-only at
815e3b9fe8e3c76ba6173d50916b1009492f9d98.

tx-agent: jcode


CodeAnt-AI Description

Document cross-harness orchestration proposals and the current KCode PR merge plan

What Changed

  • Adds a proposal for addressing rule drift across agent harnesses, noisy command output, and inconsistent subagent instructions; proposed enforcement changes are not implemented.
  • Replaces the stale KCode PR merge guidance with an updated merge order, closure recommendations, and confirmation that four earlier conflicts are already resolved.
  • Records the self-hosted runner incident, its identified cause, and remaining CI risks for operators.

Impact

✅ Clearer KCode PR merge order
✅ Fewer unnecessary conflict-resolution steps
✅ Runner and CI risks documented for operators

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Refs #143

Proposes 4 enforcement mechanisms for the "Always Subagent — main context is management-only" operator directive (2026-10-11 21:08); records the 2026-10-19 manual cross-harness propagation of the rule to all 4 derivative AGENTS.md copies (codex, forge, kcode, helioslite); lists operator-approved next steps (none yet; each mechanism awaiting decision).

tx-agent: jcode
tx-validated: manual
tx-task: governance-2026-10-19
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: capture the cross-harness propagation decision + enforcement backlog in the repo
…PR stack

tx-agent: jcode
tx-validated: manual
tx-task: governance-2026-10-19
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: give the operator a no-force-push merge order for PRs #152/#127/#140/#148/#129/#132/#134/#150/#145
tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: replace the stale 2026-10-19 PR stack plan with one built from current master ground truth
tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: replace the stale 2026-10-19 PR stack plan with one built from current master ground truth
…ne fix

The published commit 5d8a0b6 already carries the complete rewrite. This
merge is forward-only and reconciles the one-line trailing-newline
difference without rewriting published history.

tx-agent: jcode
tx-validated: manual
tx-task: 143
tx-scope: docs/sessions/2026-10-19-orchestration-governance
tx-intent: restore fast-forward parity with origin without force-push
…olved conflicts

The recomputed residuals (recomputed against origin/master 2aea04d
via git merge-tree --write-tree) now cover 12 open PRs in the KCode
stack. The four PRs previously flagged as needing hand-resolved
conflicts (#140, #127, #157, #158) have already been merged against
origin/master by a parallel agent as real 2-parent merge commits at
d6e4cfa, b6508e6, 264c09a, and 47b42e2 respectively; merge-tree
reports zero conflict markers for all four. Two new PRs (#163 transport
pipe-stem, #164 CI timeout headroom) extend the stack to 12.

The CI Quality Guardrails clippy gate has a coverage gap that no
existing PR fixes: the command is 'cargo clippy --all-targets
--all-features -- -D warnings' with no --workspace, so exactly one
workspace member (jcode-sdk) is unreachable from the root package and
is never linted. In the green run id 39390720989 the cargo test -p
jcode-sdk parity step still emitted the 'never used' warning for the
Subscriber alias at crates/jcode-sdk/src/client.rs:330. The --workspace
change is NOT a no-op and may surface additional pre-existing
violations; this is recorded as an OPEN RISK, not a resolved fact.

The KCode self-hosted runner desk-kcode-1 wedged on 2026-10-21 in the
Build & Test (desk-linux) job of run 39530002307. Root cause: the
desk WSL2 instance is capped by .wslconfig at memory=16GB (not the
64GB the Windows host has), was competing with a 1h43m orphaned
cargo llvm-cov --workspace job, and the Build step in
.github/workflows/ci.yml has no per-step run_with_timeout.py wrapper.
Remediation (terminating the orphan) brought memory from 13.9/16 GB to
9.4/16 GB and recovered the runner.

Detailed conflict resolutions and the runner wedge root-cause analysis
moved to a new companion file 05a_MERGE_EVIDENCE.md so the plan itself
fits the 500-line cap.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/sessions/2026-10-19-orchestration-governance/
tx-intent: Refresh the merge plan against recomputed 12-PR residuals + 4 applied conflict resolutions + clippy coverage gap + runner wedge
Copilot AI balanced review requested due to automatic review settings November 27, 2026 09:57
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: edfc36b1-843f-42a1-904e-5f9afba363dc
Commits

Reviewing files that changed from the base of the PR and between 787ad04 and 815e3b9.

Files selected for processing: 3

  • docs/sessions/2026-10-19-orchestration-governance/04_ORCHESTRATION_GOVERNANCE_PROPOSAL.md
  • docs/sessions/2026-10-19-orchestration-governance/05_MERGE_INTEGRATION_PLAN.md
  • docs/sessions/2026-10-19-orchestration-governance/05a_MERGE_EVIDENCE.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codeant-ai

codeant-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #d7685 Reviewed your PR 815e3b9 Nov 27, 2026 · 09:57 10:04

@codeant-ai

codeant-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Nov 27, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codeant-ai

codeant-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

1 code suggestion

1. This labels workspace clippy and the Subscriber alias as pending, but the current workflow already runs workspace clippy and the alias is gone, making the operator watch item obsolete.

Comment mismatch · docs/sessions/2026-10-19-orchestration-governance/05_MERGE_INTEGRATION_PLAN.md:187-189

@codeant-ai

codeant-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 815e3b9fe8e3


## 1. Problem statement

The "management-only root lane" rule (verbatim operator, 2026-10-11 21:08: "use subagents ALWAYS, main ctx strictly must only be management\high level ctx") is **written down** in `~/AGENTS.md` and in `~/.jcode/memories/global/harness-agents.md`, but it is **not enforceable** in any harness today. Three independent failure modes recur:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Typo in verbatim operator quote: "management\high level ctx" uses backslash instead of separator

The quote reads management\high level ctx — the backslash is likely a typo for / (management/high level) or or (management or high level). This appears in the Problem Statement quoting the operator directive from 2026-10-11.


### A. Large-output / noisy-command pre-tool hook (extension of `~/bin/jcode-tool-safety`)

- **Mechanism:** new helper `~/bin/jcode-noisy-classifier.py` invoked from `jcode-tool-safety`'s `bash` case. Pattern-matches known noisy patterns: `git log\b.*-[0-9]{2,}` (limit ≥20), `rg|grep.*-r` over multi-path, `find\b`, `ls -la\b` over `~/` or `/`, `cat\b` of `*.log` / `*.txt` files >50KB, `tail -f`, `gh pr list --json.*-L.*[0-9]{3,}`, `cargo (test|build|check|clippy)`, `npm test`, `pytest\b`, `rustc\b`. On match: increment `JCODE_NOISY_BUDGET`; if budget exhausted, route to `elicitate` with reason "noisy command in orchestrator lane; delegate to subagent or `bg run_in_background`."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Noisy command regex may match too broadly

Pattern git log\b.*-[0-9]{2,} would match git log --oneline -5 (single digit) because .* is greedy and - in --oneline satisfies the - before digits. Consider git log\b(?:\s+\S+)*\s+-[0-9]{2,}\b to match a trailing -N argument more precisely.

|---:|---|---:|---:|---|---|
| #160 | `fix/sdk-typescript-kcode-assertions` | 7 | +18 | yes | **MERGE.** Recommended SDK PR. Strict superset of #148. |
| #152 | `fix/cli-exit-status-kcode-bin` | 1 | +3 | yes | **MERGE.** Real env-var fix; see section 2.1. |
| #145 | `docs/orchestration-governance-docs-only` | 2 | +675 | yes | **MERGE.** This document. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Table lists PR #145 as "2 files" but PR changes 3 files

Section 2 table shows #145 | docs/orchestration-governance-docs-only | 2 | +675. However, this PR modifies 04_ORCHESTRATION_GOVERNANCE_PROPOSAL.md and 05_MERGE_INTEGRATION_PLAN.md AND creates new file 05a_MERGE_EVIDENCE.md (3 files total, 966 insertions per PR description). The "true residual" count should reflect all 3 files or explain why 05a is excluded.


These are binding for every step in this document and for any agent acting on it.

Forbidden:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CRITICAL: Binding constraints forbid gh pr merge/gh pr close but operator action list requires them

Section 8 (lines 349-362) lists gh pr merge and gh pr close as Forbidden commands for "every step in this document and for any agent acting on it." However, Section 6.1 (Merge, in this order) and 6.2 (Close) explicitly instruct the operator to merge 9 PRs and close 3 PRs — which requires exactly those forbidden commands. This contradiction must be resolved: either the constraints apply only to agents (not operators) and should say so, or the operator actions need different tooling.

@@ -0,0 +1,499 @@
# Merge Integration Plan - KCode PR Stack (2026-10-21T05:46Z)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Add historical context note — documents are dated Oct 2026 but PR created Nov 2026

The document header shows Date: 2026-10-21 and 2026-10-21T05:46Z but the PR was opened 2026-11-27 during a branch-retirement pass. Readers may be confused by the "future" date. Consider adding a line: Note: This document was originally written 2026-10-21 and recovered from branch docs/orchestration-governance-docs-only during 2026-11-27 branch retirement. (Applies to all three files in this session.)

Verified against the green CI run GitHub Actions run id `39390720989`,
job `Quality Guardrails`:

- The clippy step runs `cargo clippy --all-targets --all-features -- -D warnings`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Specify exact CI workflow file and step name for clippy command

Section 5.1 states the clippy step runs cargo clippy --all-targets --all-features -- -D warnings without --workspace. For verification, it would help to cite the exact workflow file (likely .github/workflows/ci.yml) and job/step name so operators can confirm the current command and the proposed --workspace change location.

@KooshaPari
KooshaPari merged commit e38809c into master Nov 28, 2026
33 of 36 checks passed
@KooshaPari
KooshaPari deleted the docs/orchestration-governance-docs-only branch November 28, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants