Commit Graph

21 Commits

Author SHA1 Message Date
dev-lead
daafb1dfbf fix(personas): sweep stale GitHub references in agent-facing prompts (Closes molecule-ai/internal#210)
GitHub org `Molecule-AI` was suspended 2026-05-06; canonical SCM is now
Gitea at git.moleculesai.app/molecule-ai. Per-agent Gitea identities are
now the default (memory: feedback_per_agent_gitea_identity_default).
Agent prompts/configs hadn't been swept yet — agents reading the brief
literally still tried `gh ...` against api.github.com (401/403) and
mis-named the SCM in PR descriptions / issue bodies.

This sweeps the per-persona system-prompts, work-cycle pick-up scripts,
and supporting persona descriptions. Mechanical patterns:

  - "GitHub issue comment, PR description"        -> "Gitea issue comment, PR description"
  - "Every GitHub comment, PR description, ..."   -> "Every Gitea comment, PR description, ..."
  - "team shares one GitHub App identity"         -> "each agent has its own Gitea persona identity"
  - "Check GitHub issues assigned to you"         -> "Check Gitea issues assigned to you"
  - "FILE A GITHUB ISSUE" / "file a GitHub issue" -> "FILE A GITEA ISSUE" / "file a Gitea issue"
  - "Molecule-AI GitHub org"                      -> "molecule-ai Gitea org"
  - "GitHub Actions CI"                           -> "Gitea Actions CI"
  - "Molecule-AI/<repo>"                          -> "molecule-ai/<repo>" (Gitea path-shape)
  - "GitHub links"                                -> "Gitea links"

Out of scope (intentionally untouched):
  - SHARED_RULES.md — already documents the post-2026-05-06 migration
  - SECRETS_MATRIX.md — historical "GitHub Apps" backlog reference (#7)
  - README.md — repo-layout doc references `.github/workflows/` directory
    name on the standard CI lib (kept for accuracy until the .github ->
    .gitea rename lands org-wide; see internal/runbooks/gitea-actions-
    migration-checklist.md §A)
  - dev-lead/triage-operator/handoff-notes.md — historical incident notes
  - .molecule-ci/scripts/*.py — uses GITHUB_WORKSPACE env (gitea-actions
    runner exposes it via GITHUB_* compatibility shims)
  - Local filesystem paths under ~/.claude/projects/-Users-hongming-
    Documents-GitHub-* — actual on-disk session memory paths
  - "Stripe/GitHub webhook signatures" reference in cp-security — talks
    about external GitHub webhook verification, not our SCM

72 files changed, 151 insertions, 151 deletions.

Tier: low (docs/config-only, no code path).
2026-05-09 22:04:35 -07:00
8710f88f93 Merge pull request 'feat(team): comprehensive PR-gate + 100% coverage + e2e + identity-tag mechanics' (#7) from feat/team-ops-comprehensive-spine into main 2026-05-09 06:47:56 +00:00
5cfeb65fc1 feat(team): comprehensive PR-gate + 100% coverage + e2e + identity-tag mechanics
Per Hongming's audit directive (2026-05-09): make the core team
operate-by-mechanism rather than self-report.

## SHARED_RULES.md §PR Merge Approval Gate (extended)
- Tag prefix corrected: `[<team>-qa-agent]` etc., not bare `[qa-agent]`.
  Bare unprefixed tags rejected by lint. Each persona has its own
  Gitea identity (post-2026-05-06; feedback_per_agent_gitea_identity_default),
  so the tag reflects who actually authored.
- Coverage bar bumped 80% → 100% per-changed-file. Aggregate
  doesn't satisfy. Doc-only files exempt.
- e2e gate added: PRs touching workspace-server/canvas/workspace/
  controlplane/plugins MUST run the matching tests/e2e/test_*.sh
  and the QA approval comment MUST report `e2e: <suite>=pass`.
- §Issue Discipline tightened to a 5-min SLA. The orchestrator
  cross-checks Loki finding-events vs Gitea issue creates and files
  a [missed-finding] issue when a finding event has no matching
  issue.
- §PR Template requirement added (links to .gitea/pull_request_template.md
  in internal + molecule-core; scripts-lint enforces).
- §Identity Tag updated: "GitHub" → "Gitea"; mechanical-parsing
  rationale spelled out.

## dev-lead/core-lead/schedules/orchestrator-pulse.md (rewritten)
- Replaces "merge CI-green PRs FIRST" with the four-condition
  gate-check sequence (CI green AND [core-qa-agent]  AND
  [core-security-agent]  AND [core-uiux-agent] -or-N/A).
- Force-merge call-out: explicitly fires incident.force_merge to
  Loki and reports to orchestrator (audit-force-merge.scripts).
- Reviewer-rotation §SOP-10 check before approving.
- Structured-logging report at end of each pulse so the
  orchestrator can monitor team behavior in Loki.
- Fixes duplicate "Step 2" (was both SCAN TEAM STATE and REVIEW
  OPEN PRs).

## dev-lead/core-lead/core-qa/system-prompt.md
- IDENTITY TAG header points at the gate-parsing role.
- 100% per-changed-file coverage codified.
- e2e mandatory on platform-touching PRs.
- New §PR Review section: required comment-on-every-open-PR each
  cycle with one of three exact forms (APPROVED/CHANGES/N-A).

## dev-lead/core-lead/core-security/system-prompt.md
- Same identity-tag fix.
- File findings as Gitea issues (was "GitHub issues") within 5 min.
- Required PR review on every PR touching auth/middleware/db/handlers/
  plugin-install; quick-N/A on the rest.
- New §PR Review section with the three exact comment forms.

Tier: medium (changes how 9 personas behave; spine of dev tree).

Verification:
- Markdown structurally consistent
- All edits surgical — no per-engineer prompt changes (those
  follow naturally from SHARED_RULES.md)
- live verification deferred to Layer C (when workspaces actually
  boot with the new prompts)
2026-05-08 23:47:28 -07:00
d331ef9f62 Merge pull request 'cleanup: local-e2e-setup.sh — symlink injection optional via --with-symlink' (#5) from cleanup/post-prd-setup-script into main 2026-05-08 12:35:40 +00:00
claude-ceo-assistant
82d1070a44 cleanup: local-e2e-setup.sh — symlink injection optional via --with-symlink
Follow-up to molecule-ai-org-template-molecule-dev PR #6 (PR-D in the
internal#77 phasing) which removed the dev-lead symlink from the parent
template. Without this update, running the setup script errored out
because it required a symlink that the parent no longer ships.

Changes:
  - Default mode: clone parent template only. No sibling clone, no
    symlink. The canonical local-e2e test (TestLocalE2E_ExternalDevDepartment)
    uses the !external resolver to fetch the dev tree at test runtime —
    no filesystem fixture needed.
  - --with-symlink flag: keeps the legacy sibling-clone + symlink layout
    for the symlink-based regression tests
    (TestLocalE2E_DevDepartmentExtraction + TestLocalE2E_FilesDirConsumption).
    Script INJECTS the symlink (since parent no longer ships it post-PR #6).
  - Updated 'Run tests' guidance: !external test is the canonical e2e;
    symlink tests are opt-in regression coverage for the path the resolver
    still supports but no production template uses.

VERIFIED LOCALLY 2026-05-08:
  - Default mode: clone parent only, layout correct.
  - --with-symlink mode: parent + dev-department + injected symlink, layout correct.
  - Full TestLocalE2E_* test suite passes against --with-symlink fixture (1.7s).

Refs:
  internal#77 — extraction RFC
  molecule-ai/molecule-ai-org-template-molecule-dev#6 — PR-D (symlink removal)
  task #235 follow-up — finishes the cleanup the PR-D description mentioned
2026-05-08 05:35:25 -07:00
dabfd2d1be Merge pull request 'fix(validator): path-string symlink semantics + add local-e2e setup script' (#4) from fix/validator-symlink-semantics into main 2026-05-08 11:47:39 +00:00
claude-ceo-assistant
f474e9c942 fix(validator): match platform's path-string symlink semantics + add local-e2e setup script
Two follow-ups discovered while pre-flighting local platform spin-up
(internal#77 dev-department extraction):

VALIDATOR (closes task #231)
  Previous validate-tree.py used Path.resolve() everywhere — Python's
  realpath equivalent that follows symlinks. Caused false positives on
  parent template's cross-repo symlink (dev-lead → sibling repo):
  validator reported 'resolves outside repo root' even though the
  platform's resolveYAMLIncludes (workspace-server/internal/handlers/
  org_include.go) accepts the path because filepath.Abs/Rel operate on
  path STRINGS, not on the realpath.

  Fix: introduce _abs_no_symlink_resolve() helper using os.path.abspath
  (string-only) and _is_inside_root() that mirrors Go's filepath.Rel +
  HasPrefix idiom. All places where the validator emulates the platform
  security check now use these helpers; Path.resolve() is reserved for
  cases that need realpath semantics (none currently).

  Verified: validator now passes on parent template's dev-lead symlink
  (was previously a hard error), still rejects truly-out-of-root
  references (e.g. ../../../etc/passwd-style escapes).

LOCAL E2E SETUP SCRIPT (DX win)
  New .molecule-ci/scripts/local-e2e-setup.sh — bootstraps the
  /tmp/local-e2e-deploy/ sibling-clone fixture used by
  workspace-server's TestLocalE2E_* tests. Idempotent (pulls latest)
  with --fresh to wipe and re-clone. Exits non-zero with diagnostics
  if the parent template's dev-lead symlink is missing or broken
  (catches stale parent-template clones from before PR #5).

Refs:
  internal#77 — extraction RFC
  task #231 — validator-vs-platform symlink semantics
  Hongming GO 2026-05-08 ('go' on the 3 pre-spin-up optimizations)
2026-05-08 04:46:50 -07:00
321979e4dc Merge pull request 'atomize(dev-tree): nest sub-teams under dev-lead/, dissolve teams/, --strict CI gate (Phase 3c-3)' (#3) from atomize/lift-subteams-into-dev-lead into main 2026-05-08 11:12:38 +00:00
claude-ceo-assistant
1dd614a4f1 atomize(dev-tree): nest sub-teams + leaf workspaces under dev-lead/, dissolve teams/
Phase 3c-3 of internal#77 (dev-department extraction).

Atomization completes the structural goal of the RFC (Hongming Q3+Q5):
each workspace is a self-contained folder; no cross-tree '..' refs;
the validator can enforce orphans-impossible-by-construction in --strict mode.

What changed:

  Folder moves (history preserved via git mv):
  - core-be, core-fe, core-qa, core-security, core-uiux, core-devops,
    core-offsec → core-lead/<self>/
  - cp-be, cp-qa, cp-security → cp-lead/<self>/
  - app-fe, app-qa, technical-writer, documentation-specialist
    → app-lead/<self>/
  - infra-sre, infra-runtime-be → infra-lead/<self>/
  - sdk-dev, plugin-dev → sdk-lead/<self>/
  - core-lead, cp-lead, app-lead, infra-lead, sdk-lead,
    release-manager, integration-tester, fullstack-engineer,
    triage-operator → dev-lead/<self>/

  Workspace.yaml content:
  - dev-lead/workspace.yaml: lifted from teams/dev.yaml. children: paths
    rewritten from team-yaml-style ('!include core-platform.yaml') and
    floater-style ('!include ../release-manager/workspace.yaml') to
    canonical './<child>/workspace.yaml'.
  - dev-lead/<sub-team>-lead/workspace.yaml: lifted from teams/<sub-team>.yaml.
    children: paths rewritten from '../<child>/workspace.yaml' to
    './<child>/workspace.yaml'.
  - dev-lead/app-lead/documentation-specialist/workspace.yaml: lifted from
    teams/documentation-specialist.yaml (Q1 placement).
  - dev-lead/triage-operator/workspace.yaml: lifted from
    teams/triage-operator.yaml (Q2 placement).
  - All files_dir: paths updated to full path-from-org-root
    (e.g. 'core-be' → 'dev-lead/core-lead/core-be',
     'core-lead' → 'dev-lead/core-lead', etc.). When parent template
    imports via the 'dev-lead' symlink (Phase 3d), files_dir resolves
    correctly relative to parent's org-root.

  Manifest:
  - dev-department.yaml roots: changed from '!include teams/dev.yaml'
    to '!include ./dev-lead/workspace.yaml'.

  Composition layer:
  - teams/ entirely deleted (8 yaml files removed). The composition is
    now expressed structurally via the folder tree.

  CI gate:
  - .github/workflows/validate.yml runs validate-tree.py --strict.
    Cross-tree '..' refs now hard-fail.

Validator state on this commit (--strict):
  filesystem workspace folders : 28
  reachable from manifest      : 28
  orphans                      : 0
  cross-tree '..' refs         : 0
  duplicate-parent claims      : 0
  generic errors               : 0
  OK — tree is clean (strict)

Refs:
  internal#77 — extraction RFC
  Hongming Q3+Q5 (atomization) + Q1+Q2 (doc-spec + triage-op placement)
  + 'dont wait for me, follow the plan' 2026-05-08
  SOP Phase 3c-3 — task #229
2026-05-08 04:08:22 -07:00
6debb12c09 Merge pull request 'extract(dev-tree): port dev tree from molecule-ai-org-template-molecule-dev (Phase 3c-2)' (#2) from extract/dev-tree-history into main
All checks were successful
Validate dev-department tree / Validate tree (push) Successful in 1m1s
2026-05-08 11:04:22 +00:00
claude-ceo-assistant
711f011ec1 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
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
2026-05-08 04:02:00 -07:00
claude-ceo-assistant
193100b04a merge: rebase extracted dev tree onto dev-department scaffold
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
2026-05-08 03:56:12 -07:00
476b0b9992 Merge pull request 'scaffold(0001): validator + CI gate + dev-department.yaml manifest' (#1) from scaffold/initial into main
All checks were successful
Validate dev-department tree / Validate tree (push) Successful in 58s
2026-05-08 10:53:57 +00:00
claude-ceo-assistant
a21212d73d scaffold(0001): validator + CI gate + dev-department.yaml manifest
All checks were successful
Validate dev-department tree / Validate tree (pull_request) Successful in 49s
Initial scaffold for the dev-department subtree repo. No workspace
content yet — that lands in Phase 3c-2 (extract dev tree with git
history from molecule-ai-org-template-molecule-dev).

Files:

- dev-department.yaml      manifest with defaults + category_routing,
                           empty roots: [] (gets populated by extract).
- .molecule-ci/scripts/validate-tree.py
                           orphan / reachability lint. Walks manifest
                           → roots → recursive children + !include,
                           compares against filesystem, reports
                           orphans + cross-tree '..' refs + duplicate
                           parents + missing workspace.yaml. Exits
                           non-zero on any violation. Stdlib only +
                           PyYAML.
- .github/workflows/validate.yml
                           CI gate runs the validator on every PR +
                           push to main/staging. Pinned action SHAs
                           per saved memory feedback_pin_third_party_actions.
- README.md                explains subtree contract: parent template
                           must symlink the dev-department under a
                           short name (e.g. `dev`), workspace
                           files_dir paths inside this repo use the
                           symlink prefix, this repo is NOT directly
                           importable as a standalone org template.
- .gitignore               ignore .env (per-workspace secrets are
                           populated by platform import, never
                           committed).
- .gitattributes           force LF on shell/Python/YAML.

Verified locally:
  - empty tree → "OK — tree is clean", exit 0.
  - cross-tree `..` fixture → exit 1, FAIL with reported violation.
  - orphan fixture → exit 1, FAIL with reported orphan folder.

Refs:
  - internal#77 (extraction RFC, Phase 1+2 done as comment 1886)
  - molecule-core#102 (symlink-resolution contract pinned by tests)
  - Hongming GO 2026-05-08 ("you own this feature and repos, start")
  - SOP Phase 3b — task #223
2026-05-07 20:48:16 -07:00
a1dbc8caf0 Initial commit 2026-05-08 03:35:37 +00:00
a0608a65cc fix(post-suspension): migrate github.com/Molecule-AI refs to git.moleculesai.app (Class G #168) (#4) 2026-05-07 19:59:38 +00:00
851fdf5874 fix(post-suspension): migrate github.com/Molecule-AI refs to git.moleculesai.app (Class G #168)
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>
2026-05-07 12:59:14 -07:00
d63e1ce348 Merge pull request 'fix(personas): migrate gh CLI → tea (Gitea CLI) + curl-via-API across 58 personas (#45)' (#3) from fix/persona-gh-to-tea-migration into main 2026-05-07 10:01:33 +00:00
documentation-specialist
00e2e7daba fix(personas): migrate the missed gh search + gh discussions patterns (#45 follow-up)
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
2026-05-07 02:55:02 -07:00
documentation-specialist
dc966ac62d fix(personas): migrate gh CLI → tea (Gitea CLI) + curl-via-API (#45)
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)
2026-05-07 02:54:35 -07:00
65e7408dd5 import from local vendored copy (2026-05-06) 2026-05-06 13:53:42 -07:00