quality, 7 findings: _release_impl and release take one frozen ReleaseOptions (new options.py, exported from pkgmgr.actions.release) and split into small private helpers with a frozen _Prepared carrier; the three _release_impl call paths become one plus dataclasses.replace(preview=True) for the interactive preview. cli/commands/release.py and cli/parser/release_cmd.py split into helpers with arguments in the same order, so the CLI surface is unchanged; test_workflow.py uses one with-block instead of five patch decorators. CodeRabbit: with --expect-tree an existing but untracked release input (pyproject, CHANGELOG.md, flake.nix, PKGBUILD, spec, debian/changelog, Cargo files) aborts before any write; the README says the abort comes before any release file is written and the pull is not reverted.
| 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| feature/release-expect-tree | 13 files +457/-342 | 91 % | 4 % | – | – | 100 % | 87 | ✅ 90/5, tokens and velocity <= 100, security 100 % |
Evidence: tests/unit + tests/integration with PYTHONPATH=src 886 passed; 2 known gpg-in-sandbox failures in test_publish_integration. quality check --staged 0 findings, ruff clean, MEDUSA 100 %, critical 0. Hub review e12f7e62ce35b6f5.
Refs https://github.com/kevinveenbirkenbach/package-manager/pull/19
Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Critical #60/#61 untrusted checkout: publish-containers.yml prepare runs for workflow_run only when the triggering run succeeded, was a push and came from this repository; build and merge need prepare, so the guard covers both checkouts. Mark stable commit triggers only on push of v* tags, schedule and workflow_dispatch are unchanged. Medium #55/#56: update-flake-lock.yml pins nix-installer-action v23 and update-flake-lock v29 to commit SHAs. High: secret_service_token returns only the token and raises SecretServiceUnavailable with the same reasons, _forge_access builds the token/reason pair (#62); jinja2 select_autoescape for html/htm/xml only, scaffolding output byte-identical (#29); chmod 0o755 to 0o700 for owner-run scripts in ink.py and 7 test sites; exact URL equality in a mirror probe test. Error #33: raise unittest.SkipTest from exc. Notes: empty-except to contextlib.suppress, one import form per module, unused variable, commented-out code, assertNotIn.
| 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| fix/codeql-alerts | 28 files +92/-81 | 90 % | 3 % | – | – | 100 % | 87 | ✅ 90/5, tokens and velocity <= 100, security 100 % |
Evidence: tests/unit + tests/integration 880 passed, 574 subtests; 2 test_publish_integration failures are identical on a clone without these changes (global tag.gpgsign, sandbox blocks gpg). ruff and actionlint clean, MEDUSA 100 % critical 0 (1 accepted keyword false positive). Operator choice 7589a6f1 (swarm), operator review dcc2f461.
Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pkgmgr release --expect-tree TREE closes the window between an external audit and the fetch pkgmgr runs itself, where a push could ship an unaudited tree (Skills request, req 076). git_ops.ensure_head_tree compares git rev-parse HEAD^{tree} with the given sha and raises RuntimeError on mismatch; _release_impl calls it right after ensure_clean_and_synced and before any file write, release() with --retry before retry_release pushes anything. expect_tree is keyword-only without a default and every caller passes it. README section added; the --force help is reworded (MEDUSA EXA004 false positive on the old text).
| 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| feature/release-expect-tree | 9 files +120/-11 | 93 % | 2 % | – | – | 100 % | 91 | ✅ 90/5, tokens and velocity <= 100, security 100 % |
Evidence: 45 targeted tests OK (5 new expect-tree tests), full unit suite 521 OK, ruff clean, MEDUSA 100 % critical 0. Break 2 %: an external caller of release() or _release_impl() must now pass expect_tree. Operator review 91234f6d (re-card of f538413a).
Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pkgmgr config edit ran nano through run_command, which pipes stdout and stderr to capture them, so nano aborted with 'Standard output is not a terminal'. The editor now runs with subprocess.call and the inherited terminal, and a failing editor exits with its code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repository-wide mechanical cleanup so `ruff check src tests` has a chance
of passing; no behavioural changes.
- Add `from __future__ import annotations` where PEP 604 unions are used.
This has to come first: pyproject declares requires-python >= 3.9, where
`X | None` is not evaluable at runtime unless annotations are stringified.
- Replace typing.List/Dict/Tuple/Set with the builtin generics and
Optional[X] with X | None, then drop the imports that became unused.
The four actions/*/__init__.py files needed this by hand because ruff
leaves unused imports in __init__.py alone (possible re-exports).
- Strip shebangs from 72 importable modules. None of them are executable
or invoked directly; the entry points are console_scripts and runpy.
- Flatten nested `with` blocks, collapse needless-bool returns, and apply
the remaining mechanical ruff fixes (PIE810, FLY002, PERF102, FURB192,
RUF059, I001).
- Pass check=False explicitly to the four subprocess.run() calls that
inspect returncode themselves. That is the existing default.
Two rewrites are visible to mocks, so their tests move with them:
subprocess.run(stdout=PIPE, stderr=PIPE) became capture_output=True, and
open(path, "r", ...) lost the redundant mode.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Repository-wide formatting pass over src/ and tests/: sorted imports and
__all__ entries, dropped redundant `# -*- coding: utf-8 -*-` headers,
unquoted forward-reference annotations (safe under
`from __future__ import annotations`), merged nested `with` statements,
moved `Iterable` and friends from `typing` to `collections.abc`, and
removed `# noqa: F401` markers that no longer suppress anything.
No behavioural changes. Unit and integration suites show the same four
pre-existing failures before and after the pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Walks a directory of numbered NNN-topic.md files, promotes every file
with zero unchecked task-list items into the directorys README under
the ## Archive section, then deletes the source file. Keeps spec
directories (typically docs/requirements) short and focused on open
work.
The action ships as pkgmgr.actions.archive with four leaf modules
(discovery, inspect, readme, workflow) and is wired into the CLI as
pkgmgr archive [DIR] [--readme PATH] [--dry-run] [--include-template].
Extracted verbatim from cli/contributing/requirements/archive in
infinito-nexus-core so every kpmx-managed repository can rely on the
same archival convention without copy-pasting helpers. Twenty unit
tests cover discovery, inspection, README merge, and end-to-end
workflow paths.
Also: realign tests/unit/pkgmgr/cli/commands/test_release.py with the
new run_release(retry=False) signature shipped in v1.14.0.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Move VS Code workspace logic (incl. guards) from cli.commands.tools into cli.tools.vscode
* Extract shared repo path resolution into cli.tools.paths and reuse for explore/terminal
* Simplify cli.commands.tools to pure orchestration via open_vscode_workspace
* Update existing tools command unit test to assert delegation instead of patching removed internals
* Add new unit tests for cli.tools.paths and cli.tools.vscode (workspace creation, reuse, guard errors)
https://chatgpt.com/share/69419a6a-c9e4-800f-9538-b6652b2da6b3
- Run publish automatically after successful release
- Add --no-publish flag to disable auto-publish
- Respect TTY for interactive/credential prompts
- Harden repo directory resolution
- Add integration and unit tests for release→publish hook
https://chatgpt.com/share/693f335b-b820-800f-8666-68355f3c938f
* Introduce publish action with PyPI target detection via MIRRORS
* Resolve version from SemVer git tags on HEAD
* Support preview mode and non-interactive CI usage
* Build and upload artifacts using build + twine with token resolution
* Add CLI wiring (dispatch, command handler, parser)
* Add E2E publish help tests for pkgmgr and nix run
* Add integration tests for publish preview and mirror handling
* Add unit tests for git tag parsing, PyPI URL parsing, workflow preview, and CLI handler
* Clean up dispatch and parser structure while integrating publish
https://chatgpt.com/share/693f0f00-af68-800f-8846-193dca69bd2e
The old test tests/unit/pkgmgr/actions/test_branch.py has been removed because:
- it targeted the previous monolithic pkgmgr.actions.branch module structure
- its patch targets no longer match the refactored code
- its responsibilities are now fully covered by the new, dedicated unit,
integration, and E2E tests for branch actions and CLI wiring
This avoids redundant coverage and prevents misleading or broken tests
after the branch refactor.
https://chatgpt.com/share/693bcc8d-b84c-800f-8510-8d6c66faf627
- Use _resolve_repository_path() for explore, terminal and code commands
so tools no longer rely on a 'directory' key in the repository dict.
- Fall back to repositories_base_dir/repositories_dir via get_repo_dir()
when no explicit path-like key is present.
- Make VS Code workspace creation more robust (safe default for
directories.workspaces and UTF-8 when writing JSON).
- Add unit tests for handle_tools_command (explore, terminal, code) under
tests/unit/pkgmgr/cli/commands/test_tools.py.
- Add E2E/integration-style tests for the tools subcommands' --help
output under tests/e2e/test_tools_help.py, treating SystemExit(0) as
success.
This change fixes the KeyError: 'directory' when running 'pkgmgr code'
and verifies the behavior via unit and integration tests.
https://chatgpt.com/share/69393ca1-b554-800f-9967-abf8c4e3fea3