Skip to content

feat(hookify): codify DeploymentGovernance canonical policies from chittyagent-tasks incident#4

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-chittyagent-tasks-queue-error
Open

feat(hookify): codify DeploymentGovernance canonical policies from chittyagent-tasks incident#4
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-chittyagent-tasks-queue-error

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 24, 2026

chittyagent-tasks worker v1.2.0 was deployed ahead of main while a migration freeze was active, causing every createTask call to fail with column "notify_policy" does not exist. The Foundation layer had no canonical contract preventing this class of drift.

Changes

  • packages/hookify/src/index.js — adds DeploymentGovernance class with four canonical policies distilled from the incident:
Policy ID Enforcement Guard
deploy-from-main block commit must be reachable from origin/main
version-pin block declared V constant must match tag/commit
migration-freeze-interlock block no new column refs while freeze notice is present
beacon-mismatch-alert alert deployed version absent from main-branch git log
  • DeploymentGovernance is exported alongside the existing HookContract, HookRegistry, HookGovernance exports — downstream implementations (CHITTYOS/chittyops) consume it to enforce these gates in CI.

  • .gitignore — adds exclusions for node_modules/, package-lock.json, dist/.

Usage

import { DeploymentGovernance } from '@chittyfoundation/hookify';

const gov = new DeploymentGovernance();
const result = gov.checkDeployment({
  onMain: false,               // not on main
  versionMatches: true,
  migrationFreezeActive: true,
  addsNewColumnRefs: true,     // adds notify_policy ref
});
// result.allowed === false
// result.blocked → [deploy-from-main, migration-freeze-interlock]

Copilot AI and others added 2 commits April 24, 2026 14:56
Codifies the four deployment governance contracts identified in the
chittyagent-tasks queue incident (#2,
chittyos/chittyops#45):

  - deploy-from-main (block)
  - version-pin (block)
  - migration-freeze-interlock (block)
  - beacon-mismatch-alert (alert)

DeploymentGovernance is now exported from @chittyfoundation/hookify
alongside HookContract, HookRegistry, and HookGovernance.

Agent-Logs-Url: https://github.com/chittyfoundation/.chittyops/sessions/0e3f14e5-ef11-4b52-a583-fe0733ebbffc

Co-authored-by: chitcommit <208086304+chitcommit@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix chittyagent-tasks queue write-broken issue feat(hookify): codify DeploymentGovernance canonical policies from chittyagent-tasks incident Apr 24, 2026
Copilot AI requested a review from chitcommit April 24, 2026 14:57
@chitcommit chitcommit marked this pull request as ready for review May 9, 2026 02:54
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2947779270

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +271 to +275
* @param {boolean} deployment.onMain - Commit is reachable from origin/main
* @param {boolean} deployment.versionMatches - Declared version matches the tag/commit
* @param {boolean} deployment.migrationFreezeActive - A migration freeze notice is present
* @param {boolean} deployment.addsNewColumnRefs - Deployment adds new schema column references
* @returns {{ allowed: boolean, violations: { policy: string, severity: string, message: string }[], blocked: { policy: string, severity: string, message: string }[] }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Evaluate beacon-mismatch-alert in deployment checks

The new class declares beacon-mismatch-alert as a canonical policy, but checkDeployment has no input or rule to detect when a deployed version is missing from main, so callers relying on this method cannot emit the required alert for that drift scenario. This means one of the four documented incident-derived policies is effectively unenforceable through the provided evaluation API.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[incident] chittyagent-tasks queue is write-broken — blocks all multi-session coordination

2 participants