Metadata-Version: 2.4
Name: governance-core
Version: 0.6.0
Summary: Reusable multi-agent governance infrastructure (hooks + proposal + wrap-up + constitution iteration) extracted from agent-core (P-0059).
Author: agent-core core agent
License: governance-core -- Source-Available License, version 1
        
        Copyright (c) 2026 napheir. All rights reserved.
        
        1. Source availability.
           The source code of governance-core ("the Software") is made available for
           you to read, audit, and modify. You may create forks and derivative copies
           of the source code.
        
        2. Use requires authorization.
           "Use" of the Software means employing it to govern a project -- including
           installing or upgrading its governance layer into any project through the
           `governance-core` command-line interface or any equivalent mechanism. Use
           of the Software REQUIRES a valid authorization code issued by the
           maintainer. No license to Use the Software is granted in the absence of a
           valid authorization code.
        
        3. Reservation of rights.
           Except as expressly stated in Sections 1 and 2, no rights are granted. All
           rights not expressly granted are reserved by the copyright holder.
        
        4. No warranty.
           THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
           IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
           FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
           AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
           LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
           FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
           DEALINGS IN THE SOFTWARE.
        
        ----------------------------------------------------------------------
        governance-core versions 0.1.2 through 0.1.6 were released under the MIT
        License; that grant is not changed retroactively. This Source-Available
        License applies from version 0.2.0 onward.
        
Keywords: claude-code,multi-agent,governance,proposal,hooks
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: filelock>=3.12
Requires-Dist: python-frontmatter>=1.0
Requires-Dist: PyYAML>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# governance-core

[![PyPI](https://img.shields.io/badge/PyPI-0.1.0a0-blue)](https://pypi.org/project/governance-core/)
[![License](https://img.shields.io/badge/License-Source--Available-orange.svg)](LICENSE)

**Reusable multi-agent governance infrastructure for Claude Code projects.**

Drop-in package providing a complete governance layer (constitution clauses,
safety hooks, proposal workflow, wrap-up discipline, cross-clone sync) so
you can focus on your project's business logic instead of re-inventing
multi-agent coordination from scratch.

## What you get

Install this package + run `governance-core install` in a new project, and
your project immediately has:

- **5 safety hooks** (PreToolUse + PostToolUse): scope-guard, edit-write-guard,
  session-boundary-guard, command-guard, sensitive-data-guard — all configurable
  via `.governance/config.json`
- **Proposal workflow** (`/proposal` skill): classify gate, draft / submit /
  approve / complete / archive state machine with audit trail
- **Wrap-up discipline** (`/wrap-up` skill): STATE.md + git + knowledge
  publishing + skill learning in one command
- **Constitution iteration** (`/iterate-constitution` skill): structured
  constitutional change workflow with red-line audit
- **Cross-clone coordination** (`/sync-infra`, `/sync-repos`): physical-files
  sync + cross-repo git operations
- **17 constitution clauses** (`art_00`..`art_16` + appendix) covering ritual,
  config management, contracts, scope governance, test/prod unification,
  git discipline, artifacts, constitutional protection, wrap-up discipline,
  memory staleness, etc.

## Authorization

governance-core is **source-available**: you may read, audit, and fork the
source freely. **Using** it to govern a project — running `governance-core
install` / `upgrade` — requires a valid **authorization code** issued by the
maintainer. `install` verifies the code offline (no network) against a public
key bundled in the package; without a valid code the governance layer is not
materialized.

`install` also requires **candidate-uplink consent**: improved skills, hooks,
and mechanisms detected in your project may be packaged as candidates and
uploaded to governance-core's public repository for review. In the current
version this consent is mandatory — declining it aborts the install.

```bash
governance-core install --project-root . --auth-code GC1.<...> --accept-candidate-uplink
```

To obtain an authorization code, contact the maintainer. See
[LICENSE](LICENSE) for terms.

## Quick start

This package is one half of a 2-piece distribution. The other half is
[multi-agent-template](https://github.com/napheir/multi-agent-template) — a
cookiecutter template + bootstrap CLI that generates a new project skeleton.

Typical workflow:

```bash
# One-time setup (per machine)
pip install cookiecutter
pip install governance-core
pip install multi-agent-bootstrap

# Per-project: one-line bootstrap
multi-agent-bootstrap new my-project \
    --agents core,data \
    --ritual-phrase "Acknowledged"

# Verify
cd ~/workshop-claude/my-project
governance-core doctor --project-root .
```

See [docs/architecture.md](docs/architecture.md) for the full picture
(generic vs business boundary, config injection mechanism, upgrade flow,
cross-clone coordination).

## Standalone CLI usage

You can also install governance-core directly into an existing multi-agent
project (without cookiecutter):

```bash
cd /path/to/your/project
pip install governance-core

# Write .governance/config.json with your project config
mkdir -p .governance
cat > .governance/config.json <<EOF
{
  "project_name": "my-project",
  "ritual_phrase": "OK",
  "core_agent_name": "core",
  "agents": [
    {"name": "core", "branch": "master", "clone_dir": "agent-core"}
  ]
}
EOF

# Render clauses + install hooks/skills (requires an authorization code)
governance-core install --project-root . --auth-code GC1.<...> --accept-candidate-uplink

# Validate
governance-core doctor --project-root .
```

Subsequent updates: `git pull` this repo, `pip install -e . --upgrade`,
then `governance-core upgrade --project-root /path/to/your/project` (this
preserves your `.governance/config.json` but refreshes clauses/hooks/skills).

## Example content disclaimer

Some clauses and knowledge docs in this package contain examples drawn from
the **upstream project** where governance-core was first developed (domain
terminology, pipeline names, broker/API references, agent name conventions).
These are **explanatory examples**, not requirements. Your project's
`.governance/config.json` supplies its own agent names, ritual phrase, and
clause keywords; the package's logic is project-agnostic.

A v1.0 release will template-ize all example tables; v0.1.0 ships with
disclaimers attached to mixed clauses and methodology docs.

## Project status

**v0.1.0-alpha** (2026-05):
- API may break between minor versions (0.1.x)
- Stable from 1.0.0 onwards
- Bug reports + PRs welcome

## License

MIT — see [LICENSE](LICENSE).

## Related

- [multi-agent-template](https://github.com/napheir/multi-agent-template) —
  companion cookiecutter template + bootstrap CLI
- Trade Agent (the project where this package was first developed) — private
