@miller-tech/uap 1.130.0 → 1.130.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ # pay2u Policy Pack
2
+
3
+ A selectable, example policy pack ported from the pay2u project
4
+ (`~/dev/miller-tech/pay2u/policies/`, originally extracted from its `AGENTS.md`
5
+ during `uap setup`). It bundles three project-shaped policies that demonstrate
6
+ the "custom architecture / reference" policy type — load-bearing invariants,
7
+ cluster reference cards, and an enforcement-hooks summary.
8
+
9
+ These are **advisory** policies (`RECOMMENDED`, no Python enforcer): they are
10
+ surfaced to the agent as reviewable rules and shown in the policy matrix /
11
+ `uap policy list`, but they do not hard-block tool calls. They are opt-in — not
12
+ part of the default policy set — so ordinary projects aren't burdened with
13
+ pay2u-specific content. Select the pack during `uap setup` (policy matrix →
14
+ "pay2u policy pack") or install individually with `uap policy install <name>`.
15
+
16
+ ## Contents
17
+
18
+ | Policy | Category | What it captures |
19
+ |---|---|---|
20
+ | `pay2u-architecture-rules` | architecture | The non-negotiable, ADR-indexed invariants (COOKIE-ONLY, ZITADEL-IDP, OO-UNIFIED, PIPELINE-ONLY, THREE-CLUSTERS). An edit that would violate one must STOP and surface the conflict against the referenced ADR rather than silently working around it. |
21
+ | `pay2u-quick-reference` | reference | Cluster cheat-sheets (MAIN / OPENOBSERVE / ZITADEL — purpose, URLs, node sizing, TLS challenge type) and the 3-phase Istio cluster-recreation procedure. Fast orientation for infra work. |
22
+ | `pay2u-enforcement-hooks` | process | The inventory of installed enforcement hooks (policy-gate, pre/post tool-use, compaction, stop, session-end) and how gating differs per harness (hard for MCP-routed tools, advisory for Codex-native edit/bash). |
23
+
24
+ ## Using the pack
25
+
26
+ - **During setup:** `uap setup` → enable the policy engine → check **"pay2u policy pack"** in the policy matrix. All three install and enable together.
27
+ - **Individually:** `uap policy install pay2u-architecture-rules` (etc.).
28
+ - **Manage:** `uap policy matrix` lists every policy (built-in + pack + installed) with its status/level/stage; adjust with `uap policy toggle|enable|disable|level|stage <id>`.
29
+
30
+ ## Adapting for your own project
31
+
32
+ This pack is intentionally pay2u-specific to serve as a worked example. To make
33
+ your own architecture pack, copy these files, replace the invariants / cluster
34
+ cards / hook list with yours, keep the `**Category**` / `**Level**` /
35
+ `**Enforcement Stage**` / `**Tags**` frontmatter, and either drop them in your
36
+ project's `./policies/` (custom policies dir) or add them here as a new pack.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miller-tech/uap",
3
- "version": "1.130.0",
3
+ "version": "1.130.2",
4
4
  "description": "Autonomous AI agent memory system with CLAUDE.md protocol enforcement",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  # adr-guard
2
2
 
3
- **Category**: architecture
3
+ **Category**: safety
4
4
  **Level**: RECOMMENDED
5
5
  **Enforcement Stage**: pre-exec
6
6
  **Tags**: adr, architecture, invariants, write-gate
@@ -2,7 +2,7 @@
2
2
 
3
3
  **ID**: `policy-merge-deploy-monitor-verify`
4
4
  **Name**: Merge, Deploy, Monitor, Verify Before Done
5
- **Category**: completion
5
+ **Category**: release
6
6
  **Level**: REQUIRED
7
7
  **Enforcement Stage**: review
8
8
  **Version**: 1.0
@@ -0,0 +1,29 @@
1
+ # pay2u-architecture-rules
2
+
3
+ **Category**: safety
4
+ **Level**: RECOMMENDED
5
+ **Enforcement Stage**: pre-exec
6
+ **Tags**: pay2u, architecture, adr, invariants, example-pack
7
+
8
+ ## Rule
9
+
10
+ These are load-bearing. If an edit would violate one of them, STOP and
11
+ surface the conflict — do not silently work around it.
12
+
13
+ | Rule ID | Invariant | ADR |
14
+ | ---------------- | ---------------------------------------------------------------------------- | ------------ |
15
+ | COOKIE-ONLY | Bearer tokens stay inside the cluster. FE holds only the httpOnly cookie. | ADR-0007 |
16
+ | ZITADEL-IDP | Zitadel is the sole OIDC provider. No second IdP without ADR update. | ADR-0004 |
17
+ | OO-UNIFIED | Unified observability plane — no parallel stacks. | ADR-0005 |
18
+ | PIPELINE-ONLY | Infrastructure changes only via pipeline (no manual prod edits). | ADR-0006 |
19
+ | THREE-CLUSTERS | Three independent cluster concerns must stay independent. | ADR-001 + contracts/critical_clusters.rego |
20
+
21
+ Full ADR index: `docs/adr/`. UAP policies enforce these at tool-call time
22
+ (see `agents/data/memory/policies.db`); when a policy blocks a call, read
23
+ the relevant ADR first, then adjust the plan.
24
+
25
+ ---
26
+
27
+ ## Why
28
+
29
+ Extracted from AGENTS.md during `uap setup` — a project-specific rule promoted to a reviewable UAP policy.
@@ -0,0 +1,29 @@
1
+ # pay2u-enforcement-hooks
2
+
3
+ **Category**: workflow
4
+ **Level**: RECOMMENDED
5
+ **Enforcement Stage**: pre-exec
6
+ **Tags**: pay2u, hooks, enforcement, example-pack
7
+
8
+ ## Rule
9
+
10
+ The following enforcement hooks are installed and run automatically:
11
+
12
+ - **uap-policy-gate.sh** - DB-driven policy gate (policies.db + .policy-tools/*.py)
13
+ - **pre-tool-use-edit-write.sh** - Blocks edits outside worktree directories
14
+ - **pre-tool-use-bash.sh** - Blocks dangerous commands (force push, terraform apply, etc)
15
+ - **post-tool-use-edit-write.sh** - Runs build gate + backup reminder after edits
16
+ - **post-compact.sh** - Re-injects policy awareness after context compaction
17
+ - **stop.sh** - Completion gate checklist + session cleanup
18
+ - **session-end.sh** - Agent deregistration + backup retention
19
+
20
+ > **Gating note (Codex):** Codex CLI has no native pre-tool-use *hook event*,
21
+ > so it cannot auto-run these scripts before every tool the way Claude Code does.
22
+ > Policy gating is enforced two ways: (1) **hard** for tools routed through the
23
+ > UAP MCP server (`[mcp_servers.uap]` below) — `execute_tool` runs the PolicyGate;
24
+ > (2) **advisory** for Codex-native edit/bash — run `bash .codex/hooks/uap-policy-gate.sh`
25
+ > per the lifecycle above. `uap hooks doctor` reports Codex as MCP-gated.
26
+
27
+ ## Why
28
+
29
+ Extracted from AGENTS.md during `uap setup` — a project-specific rule promoted to a reviewable UAP policy.
@@ -0,0 +1,89 @@
1
+ # pay2u-quick-reference
2
+
3
+ **Category**: custom
4
+ **Level**: RECOMMENDED
5
+ **Enforcement Stage**: pre-exec
6
+ **Tags**: pay2u, reference, clusters, example-pack
7
+
8
+ ## Rule
9
+
10
+ ### Cluster Cheat Sheet
11
+
12
+ ```text
13
+ MAIN (do-syd1-pay2u)
14
+ Purpose: Applications (API, Web, CMS)
15
+ URL: https://app.pay2u.com.au
16
+ Nodes: 3x s-4vcpu-8gb-amd
17
+ TLS: HTTP-01 challenges OK
18
+
19
+ OPENOBSERVE (do-syd1-pay2u-openobserve)
20
+ Purpose: ALL Observability (logs, metrics, traces)
21
+ URL: https://observe.pay2u.com.au
22
+ Nodes: 3x s-2vcpu-8gb-amd
23
+ TLS: DNS-01 challenges ONLY (Istio, no nginx)
24
+
25
+ ZITADEL (do-syd1-zitadel)
26
+ Purpose: ALL Authentication (Zitadel IAM)
27
+ URL: https://auth.pay2u.com.au
28
+ Nodes: 3x s-2vcpu-4gb-amd
29
+ TLS: DNS-01 challenges ONLY (Istio, no nginx)
30
+ ```
31
+
32
+ ### Cluster Recreation
33
+
34
+ See: `docs/architecture/CLUSTER_RECREATION_GUIDE.md`
35
+
36
+ **3-Phase Deployment** (for Istio clusters):
37
+
38
+ 1. Phase 1: Create cluster (`enable_*_cluster=true`, other flags `false`)
39
+ 2. Phase 2: Deploy Istio + cert-manager (`enable_*=true`, gateway `false`)
40
+ 3. Phase 3: Enable Gateway/VirtualService (`enable_*_istio_gateway=true`)
41
+
42
+ **NEVER use nginx ingress** - Istio handles all ingress via Gateway resources.
43
+
44
+ ### Key Workflows
45
+
46
+ ```text
47
+ cd-frontend-multicloud.yml # Frontend
48
+ cd-products-api.yml # Backend API
49
+ iac-terraform-cicd.yml # Infrastructure
50
+ security-unified.yml # Security scans
51
+ ```
52
+
53
+ ### Database Stack
54
+
55
+ ```text
56
+ PostgreSQL: CNPG with pgEdge + Spock 5.0.4
57
+ Pooler: PgDog v0.1.32 (replaced PgCat Dec 2025)
58
+ HA: 2 instances per cluster (n+1)
59
+ ```
60
+
61
+ ### IaC Exceptions (Intentionally NOT in Terraform)
62
+
63
+ ```text
64
+ OPERATOR-MANAGED (auto-generated, do not import):
65
+ - CNPG secrets: *-app, *-ca, *-replication, *-server, *-superuser
66
+ - CNPG services: *-r, *-ro, *-rw (managed by CNPG operator)
67
+ - Redis ConfigMaps: redis-configuration, redis-health, redis-scripts
68
+ - CNPG monitoring: cnpg-default-monitoring ConfigMap
69
+
70
+ EPHEMERAL (created by CI jobs, cleaned up automatically):
71
+ - k6 network policies: allow-k6-*-egress, allow-k6-*-to-api
72
+ - ACME solver: cm-acme-http-solver-* pods/services
73
+
74
+ SYSTEM (Kubernetes-managed, never import):
75
+ - kube-node-lease, kube-public namespaces
76
+ - default ServiceAccount tokens
77
+ ```
78
+
79
+ ---
80
+
81
+ **See CLAUDE.md for detailed architecture, configuration, and troubleshooting.**
82
+
83
+ </coding_guidelines>
84
+
85
+ # AGENTS.md - UAP Integration for Codex CLI
86
+
87
+ ## Why
88
+
89
+ Extracted from AGENTS.md during `uap setup` — a project-specific rule promoted to a reviewable UAP policy.
@@ -1,6 +1,6 @@
1
1
  # ship-loop-gate
2
2
 
3
- **Category**: process
3
+ **Category**: workflow
4
4
  **Level**: REQUIRED
5
5
  **Enforcement Stage**: pre-exec
6
6
  **Tags**: ship-loop, task, completion, evidence, merge-deploy-monitor-verify