# BT6 Maintainer Plugin

Cross-repository maintenance for BT6 research and support tooling. The plugin
provides queue audit, pull-request audit, external-provider assessment, issue
stewardship, conservative merge-train workflows, pre-tag release hardening, and
exact-tag release validation that adapt to each repository's configured tracker, delivery policy,
validation commands, and research/data risk surfaces.

## What this is

A marketplace delivery wrapper whose payload is the `bt6-maintainer` addon. It
generalizes the proven T3MP3ST maintainer workflow for BT6 codebases without
assuming a particular repository, tracker host, language, or application stack.

The core is read-only by default. Comments, labels, issue closure, reviews,
merges, releases, and other tracker mutations require explicit operator
authorization after the exact target repository and current PR head SHA have
been verified.

## Layout

```
.aiwg/plugins/bt6-maintainer/
├── manifest.json          # Bundle metadata (validated by aiwg)
├── README.md              # This file
└── payload/
    ├── manifest.json      # Portable addon payload
    ├── config/            # Repository profile schema
    ├── agents/
    ├── skills/
    ├── rules/
    ├── capabilities/
    ├── templates/
    └── provenance/
```

## Installation

The repository root README is the canonical installation guide. It covers the
full AIWG package, lightweight `@aiwg/cli`, and the dependency-free manual
installer for Claude Code and Codex.

### AIWG-managed deployment

On AIWG 2026.8.0 or newer, place the wrapper under the consuming repository's
`.aiwg/plugins/` directory and deploy it directly:

```bash
consumer_root=/absolute/path/to/consumer
mkdir -p "$consumer_root/.aiwg/plugins/bt6-maintainer"
cp -R .aiwg/plugins/bt6-maintainer/. \
  "$consumer_root/.aiwg/plugins/bt6-maintainer/"
cd "$consumer_root"
aiwg use bt6-maintainer
```

Direct Git installation of a standalone repository that contains its wrapper at
`.aiwg/plugins/<id>/` is tracked by AIWG #1997. Until that lands, pin and copy
the wrapper or extract a packaged provider archive rather than accepting an
`unknown` zero-artifact install.

Create `.aiwg/bt6-maintainer.yaml` in a consuming repository using
`payload/templates/bt6-repository-profile.yaml` as the starting point. When the
file is absent, the skills derive safe read-only defaults from git and
`.aiwg/aiwg.config`; they must stop rather than guess when tracker authority or
the canonical repository is ambiguous.

The shared quality model keeps contributor turnaround bounded. Pull requests run
the profile's `validation.quick` core suite, require relevant tests for behavior
changes, and enforce a 50% changed-line coverage floor where coverage is
measurable. Genuine but incomplete tests may be completed through
`maintainer-assist`; behavior changes with zero relevant tests remain blocked.
Before tagging, `bt6-release-readiness` inventories merged risk, runs the
exhaustive locally applicable gates, and repairs test, coverage, correctness,
documentation, and policy gaps. After tagging, `bt6-release-validation` binds
the same higher bar plus hosted and platform evidence to the exact immutable
tag. Readiness never substitutes for tagged certification.

Inspect health:
```bash
aiwg doctor --project-local
```

### Native deployment without AIWG

From the repository root:

```bash
node scripts/install-bt6-maintainer.mjs \
  --platform all \
  --target /absolute/path/to/consumer \
  --with-profile \
  --dry-run
```

The helper installs native provider artifacts plus a `.bt6-maintainer/`
support tree and refuses collisions unless `--force` is explicit. See the
[repository README](../../../README.md#route-c-no-aiwg-installation) for the
review/apply and verification sequence.

AIWG #1998 currently prevents reliable automated removal of freshly deployed
namespaced skill files. Inspect provider paths and preserve the registry record
needed for recovery; do not use `--force` without verifying exact ownership.

## Packaging status

The wrapper follows AIWG's project-local plugin schema and contains an addon
payload under `payload/`. AIWG 2026.8.0 validates, packages, and directly
deploys the wrapper. Remaining lifecycle gaps are:

- [#1996](https://git.integrolabs.net/roctinam/aiwg/issues/1996) — legacy
  `install-plugin --source` crashes;
- [#1997](https://git.integrolabs.net/roctinam/aiwg/issues/1997) — `aiwg install`
  does not discover nested standalone wrappers and reports zero-artifact success;
- [#1998](https://git.integrolabs.net/roctinam/aiwg/issues/1998) — immediate
  deploy/remove misclassifies generated skill files as mutated.

Validate the wrapper and smoke-test its payload:

```bash
npm run check
npm run test:smoke
```

The smoke test deploys the wrapper in an isolated temporary repository for
provider parity. Manual installer tests cover dry-run, native Claude and Codex
layouts, support files, idempotency, collision refusal, and explicit
replacement. Automated removal remains outside the passing smoke gate until
#1998 is resolved.

## Supported repository families

- Research acquisition, corpus, citation, and provenance tools.
- Knowledge-base, indexing, search, and synthesis services.
- Analyst and support utilities with local and hosted model integrations.
- CLI, API, web, and MCP tools that share backend/frontend contracts.
- Libraries and automation repositories with similar issue/PR operations.

## Provider support

- Claude: full addon deployment (agents, skills, and guardrail rule).
- Codex: full deployment through AIWG's shared Agent Skills surface plus agent
  TOMLs and guardrail rule on AIWG 2026.8.0 or newer.

## Source and license

This work is derived from the T3MP3ST project-local maintainer addon at commit
`b192577b5462d2f7388e91c83b4cb2874ab99c03`. See
`payload/provenance/SOURCE.md`. The source and this derivative are licensed
under AGPL-3.0.
