extract(dev-tree): port dev tree from molecule-ai-org-template-molecule-dev (Phase 3c-2) #2

Merged
claude-ceo-assistant merged 8 commits from extract/dev-tree-history into main 2026-05-08 11:04:23 +00:00

Summary

Phase 3c-2 of internal#77 (dev-department extraction). Brings the dev tree from molecule-ai-org-template-molecule-dev into this repo with 6 commits of git history preserved (subset of parent's 11 — git filter-repo kept only commits that touched dev paths).

Does NOT yet slim the parent template (Phase 3d, separate PR — task #225). Until parent template's wire-up lands, both repos own copies of the dev tree.

What this PR contains

File moves (extracted via git filter-repo)

  • 27 dev-tree workspace folders: dev-lead, core-{lead,be,fe,qa,security,uiux,devops,offsec}, cp-{lead,be,qa,security}, app-{lead,fe,qa}, technical-writer, infra-{lead,sre,runtime-be}, sdk-{lead,dev}, plugin-dev, release-manager, integration-tester, fullstack-engineer, documentation-specialist, triage-operator.
  • teams/ composition layer: core-platform.yaml, controlplane.yaml, app-docs.yaml, infra.yaml, sdk.yaml, documentation-specialist.yaml, triage-operator.yaml, dev.yaml.
  • Shared docs: SHARED_RULES.md, SECRETS_MATRIX.md (duplicated; parent template keeps its own copy for parent-only roles).

What was DROPPED at extract time (17 orphan folders)

Not reachable from any teams/*.yaml !include chain in parent: backend-engineer{,-2,-3}, frontend-engineer{,-2,-3}, qa-engineer{,-2,-3}, security-auditor{,-2}, platform-engineer, devops-engineer, sre-engineer, offensive-security-engineer, devrel-engineer, triage-operator-2, uiux-designer. The orphan-detection-by-construction property of the new validator means these can't sneak back in.

Manifest wired

  • dev-department.yaml roots: populated to [!include teams/dev.yaml].
  • teams/dev.yaml children: gains triage-operator.yaml as direct child (Q2 — Hongming 2026-05-08).
  • teams/dev.yaml children: does NOT add documentation-specialist.yaml directly because doc-spec is already a child of teams/app-docs.yaml (which is already a child of dev.yaml via app-lead sub-team) — adding both would be a duplicate-parent claim. Q1 intent satisfied: doc-spec is transitively under dev-lead via the app-docs sub-team.

Validator improvements (extends scaffold's PR #1)

Caught real bugs while running against the extracted tree:

  • files_dir from !include'd team yamls registers the workspace folder. Previously *-lead workspaces (declared in teams/<x>.yaml with files_dir: <x>-lead) showed up as orphans because the validator only registered files_dir for inline-at-manifest declarations. Now it also handles the indirected case.
  • Dedup inline files_dir registration after !include already registered the same folder. A workspace.yaml's top-level files_dir: matches its own folder; without this, every workspace.yaml-shaped !include double-registered.
  • Filesystem scan widens marker set. workspace.yaml is optional pre-atomization — system-prompt.md / initial-prompt.md are also recognized as workspace folder markers.
  • --strict flag (or MOLECULE_VALIDATE_TREE_STRICT=1) — makes cross-tree .. refs hard-fail instead of warn. Phase 3c-3 (atomization) flips CI to strict once .. refs are gone.

Validator state on this branch (default mode)

filesystem workspace folders : 28
reachable from manifest      : 28
orphans                      : 0
cross-tree '..' refs         : 20  [WARN]
duplicate-parent claims      : 0
generic errors               : 0
OK — tree is clean

The 20 .. warnings are the transitional teams/<sub-team>.yaml shape (e.g. teams/core-platform.yaml children: [!include ../core-be/workspace.yaml, ...]). Phase 3c-3 will lift each *-lead into a folder containing its sub-team children, dissolving teams/ entirely and removing these .. refs — at which point the CI gate flips to --strict.

Hostile self-review (SOP Phase 4)

  • Weakest spot 1: history loss for paths NOT in the filter list. SHARED_RULES.md and SECRETS_MATRIX.md are duplicated; their parent-template copies retain full history while these copies start fresh. Acceptable — they're shared docs, evolution can diverge.
  • Weakest spot 2: validator does not yet check that category_routing role names exist as name: fields anywhere in the tree. A misspelled role name would silently route to nowhere. Filed as parked follow-up.
  • Weakest spot 3: the symlink contract from molecule-core PR #102 is empirically validated through the resolver tests but has NOT yet been end-to-end verified against POST /org/import on a staging tenant. That's Phase 4 (task #226) — unblocks once parent template slim PR (Phase 3d) lands.

Refs

  • internal#77 — extraction RFC
  • molecule-core#102 — symlink-resolution contract test
  • molecule-dev-department#1 (merged) — scaffold (validator + manifest + CI gate)
  • Hongming GO 2026-05-08 ("approved, keep going")
  • SOP Phase 3c-2 — task #228
## Summary Phase 3c-2 of [internal#77](https://git.moleculesai.app/molecule-ai/internal/issues/77) (dev-department extraction). Brings the dev tree from `molecule-ai-org-template-molecule-dev` into this repo with **6 commits of git history preserved** (subset of parent's 11 — `git filter-repo` kept only commits that touched dev paths). Does NOT yet slim the parent template (Phase 3d, separate PR — task #225). Until parent template's wire-up lands, both repos own copies of the dev tree. ## What this PR contains ### File moves (extracted via `git filter-repo`) - **27 dev-tree workspace folders**: `dev-lead`, `core-{lead,be,fe,qa,security,uiux,devops,offsec}`, `cp-{lead,be,qa,security}`, `app-{lead,fe,qa}`, `technical-writer`, `infra-{lead,sre,runtime-be}`, `sdk-{lead,dev}`, `plugin-dev`, `release-manager`, `integration-tester`, `fullstack-engineer`, `documentation-specialist`, `triage-operator`. - **teams/ composition layer**: `core-platform.yaml`, `controlplane.yaml`, `app-docs.yaml`, `infra.yaml`, `sdk.yaml`, `documentation-specialist.yaml`, `triage-operator.yaml`, `dev.yaml`. - **Shared docs**: `SHARED_RULES.md`, `SECRETS_MATRIX.md` (duplicated; parent template keeps its own copy for parent-only roles). ### What was DROPPED at extract time (17 orphan folders) Not reachable from any `teams/*.yaml` `!include` chain in parent: `backend-engineer{,-2,-3}`, `frontend-engineer{,-2,-3}`, `qa-engineer{,-2,-3}`, `security-auditor{,-2}`, `platform-engineer`, `devops-engineer`, `sre-engineer`, `offensive-security-engineer`, `devrel-engineer`, `triage-operator-2`, `uiux-designer`. The orphan-detection-by-construction property of the new validator means these can't sneak back in. ### Manifest wired - `dev-department.yaml roots:` populated to `[!include teams/dev.yaml]`. - `teams/dev.yaml children:` gains `triage-operator.yaml` as direct child (Q2 — Hongming 2026-05-08). - `teams/dev.yaml children:` does NOT add `documentation-specialist.yaml` directly because doc-spec is already a child of `teams/app-docs.yaml` (which is already a child of dev.yaml via app-lead sub-team) — adding both would be a duplicate-parent claim. Q1 intent satisfied: doc-spec is transitively under dev-lead via the app-docs sub-team. ### Validator improvements (extends scaffold's PR #1) Caught real bugs while running against the extracted tree: - **files_dir from !include'd team yamls registers the workspace folder.** Previously `*-lead` workspaces (declared in `teams/<x>.yaml` with `files_dir: <x>-lead`) showed up as orphans because the validator only registered files_dir for inline-at-manifest declarations. Now it also handles the indirected case. - **Dedup inline files_dir registration after !include already registered the same folder.** A workspace.yaml's top-level `files_dir:` matches its own folder; without this, every workspace.yaml-shaped !include double-registered. - **Filesystem scan widens marker set.** workspace.yaml is optional pre-atomization — `system-prompt.md` / `initial-prompt.md` are also recognized as workspace folder markers. - **`--strict` flag** (or `MOLECULE_VALIDATE_TREE_STRICT=1`) — makes cross-tree `..` refs hard-fail instead of warn. Phase 3c-3 (atomization) flips CI to strict once `..` refs are gone. ## Validator state on this branch (default mode) ``` filesystem workspace folders : 28 reachable from manifest : 28 orphans : 0 cross-tree '..' refs : 20 [WARN] duplicate-parent claims : 0 generic errors : 0 OK — tree is clean ``` The 20 `..` warnings are the transitional `teams/<sub-team>.yaml` shape (e.g. `teams/core-platform.yaml children: [!include ../core-be/workspace.yaml, ...]`). Phase 3c-3 will lift each `*-lead` into a folder containing its sub-team children, dissolving teams/ entirely and removing these `..` refs — at which point the CI gate flips to `--strict`. ## Hostile self-review (SOP Phase 4) - **Weakest spot 1**: history loss for paths NOT in the filter list. SHARED_RULES.md and SECRETS_MATRIX.md are duplicated; their parent-template copies retain full history while these copies start fresh. Acceptable — they're shared docs, evolution can diverge. - **Weakest spot 2**: validator does not yet check that `category_routing` role names exist as `name:` fields anywhere in the tree. A misspelled role name would silently route to nowhere. Filed as parked follow-up. - **Weakest spot 3**: the symlink contract from molecule-core PR #102 is empirically validated through the resolver tests but has NOT yet been end-to-end verified against `POST /org/import` on a staging tenant. That's Phase 4 (task #226) — unblocks once parent template slim PR (Phase 3d) lands. ## Refs - [internal#77](https://git.moleculesai.app/molecule-ai/internal/issues/77) — extraction RFC - [molecule-core#102](https://git.moleculesai.app/molecule-ai/molecule-core/pulls/102) — symlink-resolution contract test - molecule-dev-department#1 (merged) — scaffold (validator + manifest + CI gate) - Hongming GO 2026-05-08 ("approved, keep going") - SOP Phase 3c-2 — task #228
claude-ceo-assistant added 8 commits 2026-05-08 11:02:44 +00:00
Mass-sed across all 58 persona dirs in molecule-ai-org-template-molecule-dev.

Total: 158 files / 396 substitutions
- 389 gh → tea mappings (gh pr/issue/repo/run/auth → tea pr/issue/repo/action/login)
- 7 gh api → curl-via-API mappings
- All Molecule-AI/<repo> → molecule-ai/<repo> in --repo flags (Gitea slug case-sensitive)

Plus SHARED_RULES.md migration callout block + tea install snippet:
- Tea v0.9.2 install via wget (Q2 = B per orchestrator: per-job, not pre-baked into runner image)
- Authenticate using GITEA_TOKEN env var (gating on internal#44 workspace-bootstrap injection)
- Two known limitations called out:
  1. GITEA_TOKEN required for tea/curl auth (internal#44 pending)
  2. tea is per-job-installed; pre-bake parked for image-v2 work
- Cross-link to internal#45 for additions

Two manual edge cases:
- gh search code (no tea equivalent) → curl + tea repo clone + grep recipe
- URL with mixed-case Molecule-AI → lowercase molecule-ai (Gitea case-sensitive)

3 narrative GH_TOKEN references in SHARED_RULES.md intentionally preserved
(describe an env var name, not commands).

Q1=A (mega-PR) per orchestrator dispatch 2026-05-07T09:50:08.

Refs: molecule-ai/internal#45, molecule-ai/internal#44 (GITEA_TOKEN dep)
Initial sweep missed:
- gh search issues --owner Molecule-AI (devops-engineer + plugin-dev)
- gh search prs --owner Molecule-AI (plugin-dev + triage-operator)
- gh search issues 'org:Molecule-AI ...' (devops-engineer)
- gh discussions narrative (community-manager)

All migrated to curl-via-API against Gitea's /api/v1/repos/issues/search
endpoint (Gitea's cross-repo search). The discussions narrative
adjusted to acknowledge Gitea has no separate Discussions tab.

Refs: molecule-ai/internal#45
Every persona's initial-prompt.md starts with `git clone https://github.com/Molecule-AI/<repo>.git`
which now hard-fails because the GitHub org was suspended on 2026-05-06. This
blocks every fresh agent at boot.

Changes:
- All 49 persona initial-prompt.md files: rewrite clone URLs to
  https://git.moleculesai.app/molecule-ai/<repo>.git, and switch the
  in-URL token from \${GITHUB_TOKEN} to \${GITEA_TOKEN} (matches the
  env-var contract documented in SHARED_RULES.md after the gh→tea migration).
- 4 schedule files (landingpage-check, landingpage-seo-check,
  daily-changelog) — same rewrite.
- org.yaml defaults block (3 refs + the 'if [ -n "\$GITHUB_TOKEN" ]'
  guard renamed to GITEA_TOKEN to match the new var).
- SHARED_RULES.md DOCUMENTATION_POLICY full-policy URL.
- documentation-specialist/system-prompt.md: reframed the org-profile
  table row (was 'renders on github.com/Molecule-AI', now noted as
  the now-suspended org page kept for reference).

Scope per Task #168: non-Go-module URL refs only. No go.mod / go.sum
in this repo, so this PR is complete coverage for this repo.

After this lands every persona will boot with a working clone again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Combines:
- HEAD (this branch): dev tree extracted from molecule-ai-org-template-molecule-dev
  via git filter-repo, preserving 6 of 11 parent commits that touched dev paths.
- dev-dept main (a21212d): initial scaffold — validator, dev-department.yaml,
  CI gate, README explaining subtree contract.

Phase 3c-2 of internal#77 (dev-department extraction).
Approved by Hongming 2026-05-08.

# Conflicts:
#	.gitattributes
extract(dev-tree): port dev tree from molecule-ai-org-template-molecule-dev with history
All checks were successful
Validate dev-department tree / Validate tree (pull_request) Successful in 58s
711f011ec1
Phase 3c-2 of internal#77 (dev-department extraction).

What this commit lands:

- 27 dev-tree workspace folders + teams/{core-platform,controlplane,
  app-docs,infra,sdk,documentation-specialist,triage-operator,dev}.yaml
  composition layer (extracted via git filter-repo).
- 6 commits of git history preserved for the dev paths (subset of
  parent's 11 — only commits that touched dev paths kept).
- 17 orphaned folders from parent template DROPPED at extract time
  (backend-engineer{,-2,-3}, frontend-engineer{,-2,-3}, qa-engineer{,-2,-3},
  security-auditor{,-2}, platform-engineer, devops-engineer, sre-engineer,
  offensive-security-engineer, devrel-engineer, triage-operator-2,
  uiux-designer). These were not reachable from any teams/*.yaml
  !include chain in the parent.
- dev-department.yaml roots populated to point at teams/dev.yaml.
- teams/dev.yaml gains triage-operator as a direct child (Q2). Q1
  doc-spec is already transitively under dev-lead via app-docs sub-team
  (teams/app-docs.yaml children include documentation-specialist.yaml),
  so no additional include needed there.
- Validator improvements (Phase 3b refinements):
  * Registers files_dir-declared workspace folders from !include'd
    team yamls (was missing — *-lead workspaces previously orphaned).
  * Deduplicates inline files_dir registration after !include path
    has already registered the same folder.
  * Filesystem scan now treats system-prompt.md / initial-prompt.md
    as workspace markers (workspace.yaml is optional in transitional
    shape).
  * --strict flag (or MOLECULE_VALIDATE_TREE_STRICT=1) makes
    cross-tree '..' refs hard-fail instead of warn. Phase 3c-3 will
    flip the CI gate to --strict once atomization removes them.

Validator state on this commit (default mode):
  filesystem workspace folders : 28
  reachable from manifest      : 28
  orphans                      : 0
  cross-tree '..' refs         : 20  [WARN]
  duplicate-parent claims      : 0
  OK — tree is clean

The 20 cross-tree '..' refs are the transitional teams/<sub-team>.yaml
shape pre-atomization (Phase 3c-3 lifts each *-lead workspace into a
folder containing its sub-team children, dissolving teams/ entirely).

Refs:
  internal#77 — extraction RFC
  Hongming GO 2026-05-08 + 'approved keep going' 2026-05-08
  SOP Phase 3c-2 — task #228
claude-ceo-assistant merged commit 6debb12c09 into main 2026-05-08 11:04:23 +00:00
claude-ceo-assistant deleted branch extract/dev-tree-history 2026-05-08 11:04:23 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-dev-department#2
No description provided.