Skip to content

refactor(agent): split CLI command domains from protected dev - #3639

Open
dongkeren wants to merge 6 commits into
kungfu-systems:dev/v4/v4.0from
dongkeren:feature/python-1000-line-decomposition-wave5-r4
Open

dongkeren wants to merge 6 commits into
kungfu-systems:dev/v4/v4.0from
dongkeren:feature/python-1000-line-decomposition-wave5-r4

Conversation

@dongkeren

@dongkeren dongkeren commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Wave 5 rebuilds the Python >1000-line decomposition from the current protected dev/v4/v4.0 head and splits the Agent CLI megamodule into capability-focused owners while preserving its public command surface and compatibility aliases.

This PR supersedes conflicted PR #3635. Exact R5 head a552de7ecf1115275124331c4e102de731bc393e has received native independent review and a verified portable seal. The implementation remains byte-for-byte unchanged from the independently accepted R4 source cut; R5 adds only the maintainability ADR and deterministic ADR/KFD projections required by protected delivery.

Related issue

Atlas goal 2026-08-27-kungfu-python-over-1000-line-decomposition.

Changes

  • Extract shared base, console, Hub, provider, runtime, and Work command responsibilities behind the existing Agent CLI facade.
  • Keep the facade and every extracted handwritten owner below 1000 physical lines.
  • Update the cumulative Python responsibility map and Wave 5 maintainability waiver.
  • Regenerate canonical CLI, KFD, and Xinfa projections from the current protected base.

Verification

  • ./shifu check:source passed at exact head a552de7ecf1115275124331c4e102de731bc393e; retained transcript SHA-256 is f277d5781d4298b21fadd8222f6ed07c43f2c0f0903860a1d4748cc35a89c928.
  • Source acceptance passed 1202 tests with 11 declared skips and zero failures; mypy checked 328 source files.
  • Complexity, Python structure, changed-code function-risk, semantic amplification, KFD, Python compilation, and zero-write source-boundary checks passed.
  • The Agent CLI facade is 412 lines; extracted owners are 1, 81, 229, 229, 342, 241, and 201 lines.
  • The kungfu-cli aggregate remains exactly at its protected ceiling, 22497/22497 lines.
  • Focused Agent Console contract: 143 passed, 3 skipped, 1 failed. The sole failure is the protected-base-identical run.py 936-line budget against 900; run.py is byte-identical to protected base and outside this >1000-line slice.
  • Native independent review review-370acf93671ff66d858c074e returned fit at exact head a552de7ecf1115275124331c4e102de731bc393e; review root sha256:7a4b6780f4373750ba063f5d4a9dfd74cbefdce370d378aaf0f3dd2e216b2929.
  • Portable seal sha256:b915bdf25a1fe4ba46e8c22c69f6282f7521cb3d0c04980cc8bcd4be9109ecec passed runtime-independent verification.

ADR delivery / release declaration

Evolution Map impact

Evolution impact: none

Governance risk check

  • credentials, tokens, secrets, or private logs
  • provider APIs, CLIs, OpenTelemetry, billing, quota, or usage attribution
  • official hosted or managed services
  • official branding, package names, release identity, or domains
  • release evidence, provenance, package publishing, or deployment surfaces
  • none of the above

The changed KFD and Xinfa files are canonical generated projections refreshed from the same public CLI contract; check:source verified their fixed point and source binding.

Checklist

  • Commits are signed off (DCO)
  • Documentation updated if behavior changed (no behavior change)

Signed-off-by: Keren Dong <keren.dong@kungfu.link>
(cherry picked from commit b4983e2)
Signed-off-by: Keren Dong <keren.dong@kungfu.link>
Signed-off-by: Keren Dong <keren.dong@kungfu.link>
Signed-off-by: Keren Dong <keren.dong@kungfu.link>
Signed-off-by: Keren Dong <keren.dong@kungfu.link>
@dongkeren
dongkeren marked this pull request as ready for review September 1, 2026 15:11
kungfu-origin
kungfu-origin previously approved these changes Sep 1, 2026

@kungfu-origin kungfu-origin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Independent review of exact source head c4a9094: full ./shifu check:source passed (1202 passed, 11 skipped; mypy 328 files), the focused Agent Console contract has 143 passes and 3 skips with only the explicitly excluded protected-base-identical run.py budget failure, native review review-651b5de20afe561e11de1248 returned fit, and portable seal sha256:6a0e36f0cfab3d8bc030cfaef77d61d2b3324a32e42e39ebfbcb0d70a62486bd verified.

@dongkeren dongkeren added the state/ready Ready for a bounded implementation or resolution decision label Sep 1, 2026
@kungfu-origin

Copy link
Copy Markdown
Collaborator

Buildchain dev PR admission

  • State: ready
  • Reason: source-qualified-exact-head
  • Exact head: c4a9094e37b220c5dd6cc35ac94433225bf895c5
  • Readiness: present (state/ready)
  • Receipt root: sha256:34a1174e1190ce2e096fba2b3a3faa487e2d91780a669e06663e76cb588c5cc1
  • Next action: Continue with native merge-group qualification.

GitHub auto-merge state is observed evidence only; it is not Buildchain admission authority.

@dongkeren

Copy link
Copy Markdown
Member Author

Reopening immediately to refresh the pull_request event payload after the ADR delivery manifest was corrected; source head remains unchanged.

@dongkeren dongkeren closed this Sep 1, 2026
@dongkeren dongkeren reopened this Sep 1, 2026
Signed-off-by: Keren Dong <keren.dong@kungfu.link>

@kungfu-origin kungfu-origin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Independent exact-head review: Wave 5 R5 at a552de7 preserves the accepted Agent CLI implementation; the added ADR and deterministic projections are source-qualified and sealed.

@dongkeren

dongkeren commented Sep 1, 2026 •

Copy link
Copy Markdown
Member Author

Buildchain dev PR admission

  • State: ready
  • Reason: source-qualified-exact-head
  • Exact head: a552de7ecf1115275124331c4e102de731bc393e
  • Readiness: present (state/ready)
  • Receipt root: sha256:2c45aafab64c2ce7d6a805ae607155c82335b82d0fc7666ec2ea2c326ed7c972
  • Next action: Continue with native merge-group qualification.

GitHub auto-merge state is observed evidence only; it is not Buildchain admission authority.

@dongkeren dongkeren added state/ready Ready for a bounded implementation or resolution decision and removed state/ready Ready for a bounded implementation or resolution decision labels Sep 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/ready Ready for a bounded implementation or resolution decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants