Skip to content

docs(ai-delivery): CTRL-REPO-THOTH-01 canonical shared doctrine and core repository controls - #820

Merged
ja573 merged 3 commits into
developfrom
feature/engineering/ctrl-repo-thoth-01
Aug 15, 2026
Merged

docs(ai-delivery): CTRL-REPO-THOTH-01 canonical shared doctrine and core repository controls#820
ja573 merged 3 commits into
developfrom
feature/engineering/ctrl-repo-thoth-01

Conversation

@ja573

@ja573 ja573 commented Aug 15, 2026

Copy link
Copy Markdown
Member

Summary

Implements CTRL-REPO-THOTH-01 - canonical shared doctrine and core repository controls for the Shared Engineering Control programme.

Closes/addresses #819
Parent programme: #818

What changed and why

Reconciles the AI-led delivery controls with the approved Thoth Engineering - Control & Delivery model so that:

  • Mutations are deny-by-default, granular and non-transitive. Root AGENTS.md and docs/engineering/ai-delivery/operating-model.md replace generic "may branch/commit/push/PR" grants with an explicit action list (repository read, source write, new-file creation, delete/move/rename, branch, commit, push, PR mutation, issue mutation, manual CI dispatch, provider/runtime read/write, migration execution, release/publication, merge, deployment, production activation) where authorization for one action never implies another.
  • GitHub is the durable live task ledger. operating-model.md section 3.2 defines task resumption from durable evidence (issue, spec, live branch/SHA, PR, review, CI); docs/engineering/AGENTS.md retains the ADR-0005 durable/transient distinction.
  • Cross-repository impact analysis is a formal gate (operating-model.md section 4.1, root AGENTS.md section 6.1) before substantive/contract-affecting scope is approved, with a new docs/engineering/repository-map/contracts.md recording verified ownership and consumer relationships.
  • Implementation handoffs are bounded. New docs/engineering/ai-delivery/implementation-handoff-template.md carries exact base/target/branch, write budget, authorized new files, prohibited paths, action matrix, automatic side effects, preflight, acceptance, validation, HOLD/STOP conditions and the required completion report.
  • Reports and reviews verify compliance, not just narrative. task-specification-template.md, implementation-report-template.md and independent-review-template.md add owning-issue/programme-stage/exact-base-SHA identity, cross-repository impact/consumer-compatibility fields, write-budget compliance, authorized-vs-actual actions, and automatic/manual external effects. Exact-head binding for independent review is preserved.
  • Branch topology is repository-local. branching-and-release-workflow.md is scoped explicitly to thoth-pub/thoth; other repositories' topology is authoritative in their own repository-map entries, not assumed from this document.
  • The repository map is reconciled against live evidence. New entries for standalone thoth-pub/thoth-client (Python, PyPI thothlibrary), thoth-pub/thoth-pyramid and thoth-pub/thoth-strapi; contracts.md explicitly distinguishes the standalone Python thoth-client from the internal Rust thoth-client workspace member in this repository. thoth-sphinx's branch state was independently re-verified live on 2026-08-15 (both main and develop exist and remain identical, placeholder-only).

Cross-repository impact

This is a control-doctrine change consumed by thoth-pub/thoth-app, thoth-pub/thoth-dissemination, thoth-pub/thoth-client, thoth-pub/thoth-sphinx, thoth-pub/thoth-pyramid and thoth-pub/thoth-strapi (see #818). Those repositories' own repository-local control tasks (#113, #95, #54, thoth-sphinx#1, thoth-pyramid#14, thoth-strapi#4) must not implement against this unmerged wording; they scope against the merged doctrine after this PR merges and is independently reviewed.

Files changed / new files

20 files, all within the authorized write budget for this task (verified: actual git diff --stat file list matches the budget exactly, no additions/deletions/renames outside it):

Modified: AGENTS.md, CHANGELOG.md, docs/engineering/AGENTS.md, docs/engineering/ai-delivery/README.md, docs/engineering/ai-delivery/branching-and-release-workflow.md, docs/engineering/ai-delivery/implementation-report-template.md, docs/engineering/ai-delivery/independent-review-template.md, docs/engineering/ai-delivery/operating-model.md, docs/engineering/ai-delivery/task-specification-template.md, docs/engineering/repository-map/README.md, docs/engineering/repository-map/branch-topology.md, docs/engineering/repository-map/repositories/thoth.md, docs/engineering/repository-map/repositories/thoth-app.md, docs/engineering/repository-map/repositories/thoth-dissemination.md, docs/engineering/repository-map/repositories/thoth-sphinx.md.

New: docs/engineering/ai-delivery/implementation-handoff-template.md, docs/engineering/repository-map/contracts.md, docs/engineering/repository-map/repositories/thoth-client.md, docs/engineering/repository-map/repositories/thoth-pyramid.md, docs/engineering/repository-map/repositories/thoth-strapi.md.

No deletions, moves or renames.

No runtime/schema/migration/provider effect

Documentation and control records only. No runtime, schema, migration, GraphQL, authorization-implementation, CI-workflow, branch-protection or deployment change.

Validation performed

  • git diff --check - clean.
  • Relative-link and referenced-file-existence review for every changed/new file - no broken links.
  • git diff --stat / git status --short - actual diff matches the authorized write budget exactly (20 files: 15 modified incl. CHANGELOG.md, 5 new).
  • Obsolete thoth-sphynx spelling check - none found.
  • Standalone Python thoth-client vs internal Rust thoth-client distinction reviewed for consistency across all touched files.
  • Repository/branch-name consistency spot-checked against live GitHub evidence gathered for this task (gh repo view, gh api .../branches, gh api .../compare, gh api .../contents, gh api .../commits) for thoth-app, thoth-dissemination, thoth-client (standalone), thoth-sphinx, thoth-pyramid, thoth-strapi.

Known automatic PR/CI side effects (observed, not predicted)

Opening this PR triggered the publish-to-dockerhub classifier
(.github/scripts/classify_ci_changes.py), which returned
{"docs_only": "false", "run_build": "false", "run_docker": "true", "run_migrations": "false"} and ran build_and_push_staging_docker_image,
publishing a staging-pr-820-tagged image to ghcr.io/thoth-pub/thoth
(job completed successfully). This was not a classifier failure or
misclassification: classification succeeded correctly per its own rule.

Root cause: is_documentation_path() in that script only matches
CHANGELOG.md and paths under docs/; this PR also modifies root-level
AGENTS.md, which the classifier does not recognize as documentation, so
docs_only was correctly computed as false for this diff given that rule.
The remediation commit does not touch AGENTS.md at the classifier's
top-level-path granularity any differently, so the same automatic
staging-image publication recurred on the remediation push. No manual
workflow dispatch, rerun or cancellation was performed, and none is
authorized. Fixing the classifier's documentation-path allow-list is a
CI-workflow-implementation change outside this task's authorized write
budget; it is not attempted here and may warrant a separate, explicitly
scoped control-gap follow-up under #818/#819 if the CTO wants it addressed.

Remediation applied on this branch/PR

Independent review of head 9b7f14798d59ca4a5b634eeb9d7f211f7b186c20 returned
CHANGES REQUIRED. Remediation was pushed as a second commit to this same
branch/PR (no new branch or PR opened):

  1. Removed the implicit thoth-pub/thoth develop/master default from
    shared canonical doctrine (operating-model.md,
    task-specification-template.md, implementation-handoff-template.md,
    ai-delivery/README.md); shared doctrine now speaks in terms of each
    repository's verified repository-local base/target/release branch, with
    develop/master given only as the thoth-pub/thoth worked example, and
    handoff/spec templates now explicitly distinguish a target repository's
    own AGENTS.md/local controls from thoth-pub/thoth's canonical shared
    doctrine.
  2. Corrected contracts.md and thoth-client.md: the standalone
    thoth-client verifiably consumes both the Thoth GraphQL API and the
    Thoth REST/export API (rest.py, rest_cli.py, rest_structures.py,
    README REST usage), not GraphQL alone.
  3. Added the verified thoth-pyramid -> metrics-widget (^2.0.1,
    thoth-pub/metrics-widget) package/library interface dependency to
    contracts.md and thoth-pyramid.md, without starting any
    metrics-widget task.
  4. Corrected thoth-strapi.md's CI/release description: build_docker.yml
    publishes an unconditional staging-pr-* image to GHCR on every PR
    open/update (no docs-only gating in that repository at all), distinct from
    release-triggered publication in build_docker_release.yml and from
    workflow_dispatch, which remains a separate, unauthorized manual action.

New exact head after that round: f840fdf38b704494aa0290ae4f737e66f1ce0c64.

Second remediation round

Independent review of head f840fdf38b704494aa0290ae4f737e66f1ce0c64 again
returned CHANGES REQUIRED. Remediation pushed as a third commit to this same
branch/PR (no new branch or PR opened):

  1. Added two additional verified current consumers of the Thoth GraphQL API
    to contracts.md and thoth.md: thoth-pub/metrics-dashboard
    (config/index.ts, NEXT_PUBLIC_THOTH_API_URL defaulting to
    https://api.thoth.pub/graphql) and thoth-pub/metrics-widget
    (src/shared/config/index.ts, VITE_THOTH_API_URL defaulting to the same
    URL). Distinguished this current direct-GraphQL dependency from the
    approved future protected Metrics-GraphQL/BFF architecture without
    claiming that future path is implemented. Did not modify
    metrics-dashboard.md/metrics-widget.md (outside CTRL-REPO-THOTH-01: Canonical shared doctrine and core repository controls #819's write budget)
    and did not start any implementation/control task in either repository.
  2. Reconciled CTRL-REPO-THOTH-01: Canonical shared doctrine and core repository controls #819's own issue body against verified current facts: replaced
    the stale "thoth-sphinx develop branch is absent" discovery premise with
    the verified fact that both main and develop exist and are currently
    identical, placeholder/bootstrap-only; and replaced the old
    "classifier-failure-contingent" prediction of Docker publication with the
    observed fact that classification succeeded and correctly returned
    docs_only=false because root AGENTS.md is outside the classifier's
    CHANGELOG.md/docs/** documentation-path allow-list. Also corrected an
    internal "four" vs "six" finding-count inconsistency in CTRL-REPO-THOTH-01: Canonical shared doctrine and core repository controls #819's own
    Current-gate prose. Historical evidence comments on CTRL-REPO-THOTH-01: Canonical shared doctrine and core repository controls #819 were left
    untouched (append-only).
  3. Confirmed unchanged: the internal Rust thoth-client workspace crate
    remains stated as not published independently as part of the current
    release process (historical crates.io releases predate current
    delivery) — this fact was reinforced, not altered.

New exact head: f789f3b50576c40efa0fd6050f75aac51f711970. The reviews of
9b7f1479... and f840fdf3... do not carry forward.

Remaining gate

Fresh independent exact-head review of f789f3b50576c40efa0fd6050f75aac51f711970
is required before any merge authorization. This PR must not be merged by the
implementing agent, and repository-local control tasks #113, #95, #54,
thoth-sphinx#1, thoth-pyramid#14, thoth-strapi#4 remain blocked on this
doctrine being independently reviewed and merged first.

…ore repository controls

Reconciles the AI-led delivery controls with the approved Thoth Engineering
Control & Delivery model: deny-by-default, granular, non-transitive action
authorization; GitHub as the durable live task ledger; a formal
cross-repository impact-analysis gate; extended task-specification,
implementation-report and independent-review templates; a new
implementation-handoff template; and a reconciled repository/contract map
covering standalone thoth-client, thoth-pyramid and thoth-strapi.

Closes/addresses #819
Parent programme: #818

Documentation and control records only. No runtime, schema, migration,
GraphQL, authorization-implementation, CI-workflow, branch-protection or
deployment change.
ja573 added 2 commits August 15, 2026 11:41
Remediates CHANGES REQUIRED findings from independent review of
9b7f147 on PR #820:

- Removes the implicit thoth-pub/thoth develop/master default from shared
  canonical doctrine (operating-model.md, task-specification-template.md,
  implementation-handoff-template.md, ai-delivery/README.md). Shared
  doctrine now speaks in terms of each repository's verified repository-local
  base/target/release branch, with develop/master given only as the
  thoth-pub/thoth worked example. Handoff/spec templates now explicitly
  distinguish a target repository's own AGENTS.md/local controls from
  thoth-pub/thoth's canonical shared doctrine, and no longer imply that
  docs/engineering/... exists in every target repository.
- Corrects contracts.md and thoth-client.md: the standalone thoth-client
  verifiably consumes both the Thoth GraphQL API and the Thoth REST/export
  API (rest.py, rest_cli.py, rest_structures.py, README REST usage), not
  GraphQL alone.
- Adds the verified thoth-pyramid -> metrics-widget (^2.0.1, thoth-pub/
  metrics-widget) package/library interface dependency to contracts.md and
  thoth-pyramid.md, without starting any metrics-widget task.
- Corrects thoth-strapi.md's CI/release description: build_docker.yml
  publishes an unconditional staging-pr-* image to GHCR on every PR
  open/update (no docs-only gating), separate from release-triggered
  publication in build_docker_release.yml and from workflow_dispatch, which
  remains a separate, unauthorized manual action.

No runtime, schema, migration, GraphQL, authorization-implementation,
CI-workflow, branch-protection or deployment change. No CI/workflow file
modified.

Addresses #819
Parent programme: #818
PR: #820
…cts.md

Remediates remaining independent-review finding on
f840fdf: two additional current consumers
of the Thoth GraphQL API were missing from the repository map.

- Adds thoth-pub/metrics-dashboard and thoth-pub/metrics-widget as verified
  current Thoth GraphQL consumers (config/index.ts defaults to
  https://api.thoth.pub/graphql in both repositories).
- Distinguishes this current direct-GraphQL dependency from the approved
  future protected Metrics-GraphQL/BFF architecture without implying the
  future path is implemented.
- Reinforces, without changing, the existing fact that the internal Rust
  thoth-client workspace crate is not published independently as part of
  the current release process (historical crates.io releases predate the
  current process).

Does not modify metrics-dashboard.md or metrics-widget.md (outside #819's
authorized write budget) and does not start any implementation/control task
in either repository.

No runtime, schema, migration, GraphQL, authorization-implementation,
CI-workflow, branch-protection or deployment change. No CI/workflow file
modified.

Addresses #819
Parent programme: #818
PR: #820

@ja573 ja573 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Independent review - APPROVED

Task: CTRL-REPO-THOTH-01 / #819
Parent: #818
Reviewed PR: #820
Reviewed exact head: f789f3b50576c40efa0fd6050f75aac51f711970
Decision: APPROVED

Independent control-plane review inspected the owning specification/ledger, actual 20-file PR diff and remediation commits, repository-contract evidence, write/action-budget compliance, cross-repository consumers, branch/integration state, and CI classification/external side effects. No blocking source, scope, authorization, compatibility, migration, auth/security, runtime, or prohibited-write finding remains.

The task branch was correctly created from the authorized base ed32712766c8f5a1951bb53ec3192e18f067c7d2. During review, develop advanced through merged PR #817 to 8c0c54bd7b2e58a645ffe39abd8ceeee86e47686; GitHub produced a clean integration/merge ref and the only overlapping changed path (CHANGELOG.md) retains both changes. This base movement is treated as verified compatibility evidence, not an authorization violation. If develop moves again before merge, re-check the integration state before merge authorization/execution.

The remaining automatic publish-to-dockerhub staging-image job is explicitly non-blocking by CTO direction on 2026-08-15. Classification itself succeeded and returned docs_only=false, run_build=false, run_docker=true, run_migrations=false because root AGENTS.md is outside the documentation allow-list. No manual CI action is authorized or required.

This approval is source/stage approval only. It does not authorize merge, deployment, release, migration execution, publication, or production activation. Any new source commit invalidates this approval.

@ja573
ja573 marked this pull request as ready for review August 15, 2026 11:06
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ja573
ja573 merged commit ec7868a into develop Aug 15, 2026
10 checks passed
ja573 added a commit that referenced this pull request Aug 15, 2026
Incorporates the current repository-control doctrine merged through PR #820
(develop @ ec7868a) into the BE-04
implementation branch, as authorized on issue #821.

# Conflicts:
#	CHANGELOG.md
ja573 added a commit that referenced this pull request Aug 17, 2026
Codex raised a P1 on the tracker: it described BE-04 in transient workflow
terms that merging PR #816 would immediately falsify, which is exactly what
docs/engineering/AGENTS.md section 1.1 forbids in a committed file. Merging
would have required an immediate corrective commit.

The tracker now records the durable decision instead. BE-04's status becomes
IMPLEMENTATION DELIVERED - RUNTIME INACTIVE in the summary paragraph, the
task-table Status cell and the Acceptance cell. Present-tense lifecycle
wording is removed throughout: "implementation candidate", "implementation
branch", "IMPLEMENTATION CONTROLLED BY PR #816", the claim that the
implementation is unmerged and that develop still lacks the distribution_job
relations, and "merge would authorize". Repository authority is stated as an
authority condition that attaches when the exact independently approved
content is reachable from develop, and live review, approval, CI and merge
state is left to GitHub under ADR-0005.

Historical traceability is kept: delivery through PR #816, the baseline
through PR #814, corrected Addendum 01 through PR #817, the doctrine merged
through PR #820, and the authorizations recorded on issue #821 all remain.
The wording is now true both before and after PR #816 merges.

contracts.md registered thoth-pub/baboon as a verified consumer of the Thoth
GraphQL and metadata export APIs on 2026-08-16, after this implementation
report's consumer matrix was written, so BE-04 lacked the explicit Baboon
impact assessment the cross-repository gate requires. Section 10.7 adds it as
row 8, REMAINS COMPATIBLE, with the reasoning enumerated: the GraphQL change
is additive, no existing field is removed, retyped, made stricter or given a
required argument, no existing default changes incompatibly, the export
format and export-availability semantics are untouched, the discovery fields
Baboon queries are unmodified, and DISSEMINATION_WORKER governs only the new
worker mutations. No Baboon source change or downstream task is required.

The assessment is dated honestly: it was added during this review remediation
after Baboon became a verified consumer, not during the original
implementation. Baboon was read only through this repository's own
repository-map records and was not modified.

The matrix now covers every currently verified consumer, with thoth-sphinx
kept separate as a planned future consumer rather than as compatible, and
cc-license excluded on evidence as a crate this repository consumes.

Section 1.9 records this episode: starting head baab314, incorporated
develop 6f192ea, a two-file write budget, no new files, and no runtime,
specification, GraphQL, migration or cross-repository source effect. baab314
is recorded as this episode's authorized starting state, an ordinary merge
that pre-dates it and that this agent did not create. Episode counts, the
authority table, the commit tables, the write-budget and action-authorization
matrices and the confirmations are reconciled accordingly.

The prior process-exception history is preserved unchanged: one authorized
push, two unauthorized pushes, their two unauthorized automatic staging-pr-*
publications, the CTO's acceptance, no retroactive authorization and no
cleanup requirement.

Documentation and control only. No runtime, source, test, migration,
specification, ADR, CHANGELOG, workflow or contract-map change, and no
downstream repository was touched.
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.

1 participant