Repository navigation
feat(resources)!: change one file of a teamai default, and keep any kind as a file or a folder - #1836
Conversation
The supplied PR description documents sufficient testing, including representative real-CLI world runs at head |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Reviewed at 50226a82, running the same team-repo commits through a build of this head and of main (e266fd7e) in verify worlds. The inheritance itself works:
- A team folder over a default gets the files it leaves out from teamai's version.
- A stray file is warned about and left out, and
review --branchfails on it. - Removing the override leaves nothing of the team's version behind.
${TEAMAI_AGENT_DIR}expands in workspace and user scope, and converting an agent between a file and a folder, either way, leaves no stale copy. Uninstall cleans up both forms.- Scorer folders sync.
- The per-file
layermarks inlist --jsonare right.
Several things I expected to break don't:
- A stray file in a
teamai-*folder without its marker was never delivered on main either. - The new push refusals and the refused scorer folder replace main's "cannot read yet" skips.
- The removed skipped-folders surfaces only fired for folders this head now reads.
Two things block.
[P1 blocking] Notes kept under skills/ now become skills. Any .md directly under skills/, under a namespace folder, or under an ordinary sub-folder is now delivered to every member as a skill. Only README.md is excluded. Repro: a team repo with skills/NOTES.md, skills/CONTRIBUTING.md and skills/docs/guide.md. Main (and 0.30.0) deliver nothing. This head delivers skills named NOTES, CONTRIBUTING and guide, each with a made-up description: Notes, and review --branch gains three failures on files the team never meant as skills. Teams do keep notes there; that's why README.md is excluded. Suggested fix: treat skills/<x>.md as a skill only when it has frontmatter with a description, which review --branch already requires of a skill. Notes then stay notes, and there's nothing to disclose.
[P1 blocking] No CHANGELOG entry. 0.30.0 shipped the default folders and the skipped-folders warnings, so this PR changes released behaviour, and the CHANGELOG's entries for that work now describe things it removes. It needs entries for:
- per-file inheritance of a default;
- the file and folder forms (
skills/<x>.md,AGENT.md,SCORER.md); - the removed skipped-folders doctor check, status list and dashboard panel;
- the new push refusal;
- the default scorer that only a file can replace.
Three changes that aren't in the body need a line too:
TEAMAI_AGENT_DIRis now a reserved team env name.- A lone
rules/teamai-recall/<x>.md, which main delivered as a rule of its own, is now read as part of teamai's recall rule. - A partial override such as
rules/teamai-recall/block.mdreaches a member still on 0.30.0 as a standalone always-on rule (.claude/rules/teamai-recall/block.md). I ran that on the 0.30.0 build. Teams need an "upgrade every member before you add partial overrides" note.
[P3 nit] For a one-file skill, review --branch prints a path that doesn't exist (skills/NOTES.md/SKILL.md), and says pull needs frontmatter that pull actually generates.
Not checked here: an upgrade from an installed 0.30.0 that recorded skipped folders (the unit test covers it), resuming a workflow run across the upgrade (code read only), HTTP mode, and delivery to Codex, CodeBuddy and OpenCode.
A team that changed one text of a teamai default folder had to copy the whole folder and from then on missed teamai's updates to every file it did not touch. A layout can now say its folders inherit (`inherits`): a team directory named like a teamai default folder is a folder even without its marker, and `InheritedFolders.merge` lays its files over the default's. A file replaces its whole language family (`problem.md`, `problem.zh.md`, `problem.en.md`). A team file whose family the default lacks replaces nothing and is left out, unless the team replaces the marker too. Workflows, hooks and rules turn it on. Proved by table tests of the merge (marker inherited, language family, subdirectories, strays, the marker allowing additions, dotted names that are no language).
…lt's files A team folder named like a teamai default now holds only the files it changes. Pull checks the contract on the folder both make together: a default hook's keys, ranges, texts and variables; the recall rule's kept files and lines; a workflow's references. A refused result keeps teamai's default whole, as before. A team file that replaces nothing is named in a pull warning and left out, and `review --branch` fails it. A namespace replacement of a default hook is still refused, now also when it holds only the files it changes. A run of a workflow folder that inherited a file records the team commit and the teamai version that gave the rest, and another machine refuses to continue it as definition_mismatch when that version differs. Only the team's own files are checked against the team commit. The guide, the hook and recall READMEs and the glossary drop the copy-the-whole -folder recipe. The guide's MR-learnings example copies both draft texts, since a file replaces every language of it. Proved red-first: a team hooks/teamai-friction-reminder/ holding only problem.md was not even read as a folder on main; now pull delivers teamai's other files with it and the Stop hint prints the team's text. Tests cover the stray warning and review failure for each kind, recall folders holding only block.md, a workflow folder over teamai-import-from-repo, and a claimed run refused on another teamai version (seeded failure confirmed the check).
`teamai list hooks|rules|workflows` names a team folder over a teamai default as `team, over teamai default <version> (<n> own files, <m> inherited)`, and the new `--json` flag gives each file's layer. The dashboard shows the same count on the folder and on a default hook it changes, and tags each file that comes from teamai. `--json` leaves env out: `teamai env list` lists it. Proved by list and dashboard tests over a hook, the recall rule and a workflow folder that each hold one file of their own.
A team that wants an agent to read a rubric or examples beside it had no
way to ship them: AGENT.md was a reserved marker, and pull skipped the
whole folder. Agents could only be one file.
agents/[<ns>/]<x>/AGENT.md is now an agent named after its directory,
delivered to each tool that reads Markdown agents exactly as a legacy
agents/<x>.md is, with ${TEAMAI_AGENT_DIR} rendered to where that tool
reads the folder: the worktree's .teamai/delivered/agents/<x>/ in a
workspace (absolute for Claude Code, from the project root for a tool
that reads nothing outside it), the data home in user scope, with a
one-time warning for tools that may ask before reading there. The
per-tool path choice moves from RuleFolders.render into
DeliveredFolders.renderFor, so rule and agent folders share it.
TEAMAI_AGENT_DIR is a reserved team env name, as the other folder
variables are. Push proposes nothing from a folder agent's copies.
The skipped-folder tests that used an agent folder now use a scorer
folder, the type this release still skips.
Proof: agent-folders.test.ts (user, namespace, workspace with Claude
Code and CodeBuddy, the warning, push, the name clash) and the scan
tests failed before the change and pass after; the real-CLI E2E
pull-skipped-folders-1791 now delivers agents/reviewer/ in user scope
with the rendered path.
…cope directory A delivered agent folder needs a way out and, in user scope, a way in for Claude Code, which is denied a read outside the project unless the directory is in permissions.additionalDirectories. - Pull prunes the scope's agent folders once its agent cleanup ran, keeping those of the agents it resolved and any a copy left in a tool's agents directory still names (an edited copy the member kept). A collision that holds agents skips the prune. - The user-scope grant now adds ~/.teamai/agents beside ~/.teamai/rules for a tool whose cell is grant and that receives agents, in the same checkout record, so uninstall takes both back. - teamai remove agents <x> removes the team folder and the delivered folder with the copies. - uninstall counts folder agents among the team's agents, so their copies go, and keeps a worktree's agent folder that a copy it leaves still names, as it does for rule folders. Proof: the pull-level cases in rule-folder-grant-pull.test.ts (grant and prune, the kept edited copy, teamai remove) and the uninstall cases failed before the change and pass after.
Scorer folders are about to reuse WorkflowFolder.read, which reads a folder as UTF-8 text with a 1 MB cap. Its size message said "a workflow folder may hold", which would be wrong in a scorer diagnostic. The message now says "a folder may hold"; the workflow diagnostic keeps its "is not a valid workflow folder" prefix, so the workflow case reads the same. Proof: npx vitest run src/__tests__/workflow-folders.test.ts passes with the updated expectation.
A scorer can now be scorers/[<ns>/]<name>/SCORER.md with files beside
it. SCORER.md is read as scorers/<name>.md is, and its prompt names the
folder's files through ${TEAMAI_SCORER_DIR}, spelled like
${TEAMAI_RULE_DIR}.
The judge reads only its evidence directory (the confined workspace of
teamai-score's judge step), so the files travel with the scorer rather
than being delivered under the data home:
- pull keeps every support file in the scorer's cache entry, and a run
pins them with the rubric, so a later pull does not change what judges
an open run;
- rubric.sourceHash covers the support files, so an edited file is a new
rubric and re-judges; the team revision is recorded only when the
commit holds every file of the folder;
- `score evidence` writes the pinned files to <evidence>/scorers/<name>/
and renders ${TEAMAI_SCORER_DIR} to that path in the rubric and in
prompt.md.
A folder holds UTF-8 text, no symlink, 1 MB in all, as a workflow folder
does. Pull refuses a scorers/<name>.md that names ${TEAMAI_SCORER_DIR},
and a folder named like a default scorer, whose replacement stays a file.
`teamai score --scorer ./scorers/x/SCORER.md` tries a folder with its
files. `review --branch` validates a folder as one scorer, ignores its
support files and any scoring.yaml in it, and `status` counts it once.
A later pull drops the cache entry of a removed folder.
Proof: red-first tests in folder-marker-scans, score-verbs (evidence
path, pinned support files, team revision), review-branch and
status-list; scorers-cache covers the refusals and the removal.
npm run typecheck, npm run lint and node scripts/check-docs.mjs pass.
With scorer folders read, no reserved folder type is left that this
release skips, so the skip scan of Tencent#1791 had no subject: pull, status,
doctor, review --branch, push and the dashboard no longer look for
skipped folders. A pull record an older release wrote with skipped
folders still forces one full sync, so a member who upgrades at an
unchanged team revision receives those folders at once, and pull no
longer writes the list. Push refuses to place a rule, agent or scorer
inside a folder of its type, which used to hold only for rule folders.
The guide now says only an older teamai skips a folder, and asks
members to update before the team adds an agent or scorer folder.
Proof: pull-upgrade-skipped-folders (fails when the record is ignored),
the pull-resource-folders E2E on the built CLI, and the full unit suite.
Skills were found by six hand-written walks of skills/ (the pull scan, the push index, the namespace list, the role context, uninstall and the agent view), each with its own idea of a namespace and of a skill. They now share one read, readTeamSkills, built on Resources.survey with a skills row in RESOURCE_LAYOUTS, so skills follow the same folder rules as every other type with a marker file. SKILL.md is reserved in FOLDER_MARKERS as a marker this release reads. Skill resolution stays as it was: with roles, the active namespaces plus tags; without, the shared root first. Only the read moved. What changes: - A namespace directory without SKILL.md is no longer an item of the pull scan. Pull still names it once a run, and review --branch still fails it, from the read's notSkills. - Pull kept only the last team source of a name for its removal check, which relied on readdir listing a namespace before the root. It now checks against every team copy of the name. - A declared namespace path that is a file still stops pull (ENOTDIR). Proof: the skills, desired-skills, push, pull namespace, tombstone, doctor, workspace, uninstall and review-branch suites pass. The full unit suite failed only the review-branch and ENOTDIR cases this commit then fixed. Two push --skill tests modelled the team tree with pathExists/listDirs mocks; they now build a real team tree on disk, since the read goes through the file system.
A skill that is only its instructions needed a folder holding one SKILL.md. Now skills/<name>.md, or skills/<ns>/<name>.md, is that skill: pull delivers it to each tool as <name>/SKILL.md, with its frontmatter repaired, exactly as it would that folder. - The skills layout reads .md files as skills, except SKILL.md, a README.md, hidden files and drafts. README.md stays out because team repos kept one in skills/ before a file could be a skill, and an upgrade should not start delivering it. - A skill folder's name may not end in .md, so a team skill's path tells its form. TeamSkillSource answers what a skill delivers from either form; delivery, its record, the copy checks, cleanup, recall and the dashboard read the skill through it. - A file and a folder of one name in one place define the skill twice: pull delivers neither and names both, and review --branch fails. - Push sends an edit back to the file. Files the member added beside SKILL.md stay out, named, since a file holds nothing else. - teamai remove finds the file as it finds the folder. - review --branch checks a file-form skill's name and format. An older teamai lists only directories under skills/, so it skips the file and delivers nothing for it; the guide says to upgrade first. Proof: new pull tests deliver a namespace skill file, leave README.md out, replace a root folder with a namespace file whole, remove the copy when the namespace goes inactive, and deliver neither of a file and a folder of one name. The push scan and pushItem, review --branch and the namespace scan gained file-form rows. Each new case failed before the change. The full unit suite and the role skill push E2E pass.
The improvement page walked skills/ by hand for SKILL.md folders, so a skill kept as skills/[<ns>/]<name>.md counted as a skill used outside the team repo, and never as a team skill. It now reads team skills as pull does, through readTeamSkills. Proof: dashboard-improvement fails on the old walk (2 team skills, not 3) and passes now.
… folder The TOOLS cell ruleFolders and ruleFolderReachOf now decide how a tool reads the files of a user-scope agent folder as well as a rule folder, so they are folderReach and folderReachOf, and the generated Tool support column reads "Rule and agent folder files". The stored ruleFolderGrants key keeps its name: renaming it would need a read-the-old-key path for state files already on disk, for no change in what it holds. Proof: npm run typecheck, npm run lint (generated pages regenerated), and the full unit suite pass.
teamai remove and uninstall delete an agent copy with no delivery record only when the team history proves it teamai's. The proof read the history of agents/**/<name>.*, so a copy pull rendered from agents/[<ns>/]<name>/AGENT.md was never proven and stayed behind as the member's. The proof now also compares the copy with each version of the folder's AGENT.md, rendered for the tool that holds it with its folder named where that tool reads it. A copy the member edited still matches no version and stays. A removeItem case in agents.test.ts covers both: it failed before this change because the rendered Claude Code copy was kept.
…AGENT.md When agents/<ns>/ gains an AGENT.md it becomes one agent folder, and the agents it held become its files. Pull stopped delivering them but left the copies it had written in every tool, because agent copies only go on a tombstone or a role change, and said nothing about why the agents stopped updating. Pull now removes the copies it delivered of those agents, as it does for a rule folder, keeps one the member changed, and says why once: agents/<ns>/ holds AGENT.md, so it is one folder, and vr.md in it is one of its files, no longer read on its own. An agent another place still delivers under the same name keeps its copy. The guide and the troubleshooting reference describe the change. A pull case in rule-folder-grant-pull.test.ts failed before this change: the old namespaced copy stayed.
Without a delivery record (a lost record, the local agent's install, doctor, Codex's shared directory), teamai proves a skill copy its own when every file in it is a version of the team skill in the history. The history it searched was skills/**/<name>/<file>, so a copy of a skill kept as one file, skills/[<ns>/]<name>.md, matched nothing: uninstall and remove kept it as the member's. skillOrigin now names the file form too (CopyOrigin.skillFile, skills/**/<name>.md), and the copy's SKILL.md is also checked against it, with the same frontmatter render pull applies. The four places that built a per-file origin for a skill copy share one helper. Proof: a new ownsSkillDir case, for a skill kept as a folder and as one file, proves an unrecorded copy teamai's and keeps an edited one; the one-file row failed before this change.
`teamai skill show <name>` looked for a team skill only as a folder holding SKILL.md, at the root or one namespace down. A skill kept as `skills/[<ns>/]<name>.md` was found only through an installed copy, so before a pull, or with no tool installed, it was reported missing, and after one it was labelled from the copy instead of the repo. The team lookup now reads the repo through readTeamSkills, the same read pull delivers from: the root's skill first, then each namespace's, in either form. The card reads the description from the file, prints the file as the repo path, and the verbose line names it as SKILL.md. skill-show.test.ts gains a row for each place, root and namespace; both fail with "not found" before the change.
…re push Before push, an unedited local copy of a team skill whose team version moved on is brought to that version, so the scan does not read the teammate's change as the member's edit. The team skills were found by walking folders that hold SKILL.md, so a skill kept as `skills/[<ns>/]<name>.md` was never compared: its stale copy stayed, and push offered it back as a local change. The comparison also took the local SKILL.md byte for byte, while pull writes it with the frontmatter repaired, so a copy of a team file without frontmatter always looked edited. The sync now reads the team skills through readTeamSkills, the read pull delivers from, and walks each one through TeamSkillSource, so the file form compares and copies as `<name>/SKILL.md`. A local SKILL.md counts as a team version when it holds it as the team has it or as pull writes it. An edited copy is still left alone. pre-push-sync.test.ts gains a case with a root and a namespaced one-file skill: the unedited copy, as pull delivered it, is replaced and the edited one kept. It fails before the change.
The branch review reads links between skills where pull delivers them: each skill as `<skills>/<name>/`. A skill kept as `skills/<name>.md` is delivered as `<name>/SKILL.md`, but the check looked for the link's target inside the file's path as if it were a folder, so a link such as `../greet/SKILL.md` to a sibling kept as `skills/greet.md` was reported missing although it resolves for every member who receives both. The check now resolves a target inside a one-file skill against what pull delivers for it: its directory and its SKILL.md, nothing else. A link to the file's repo path, `../greet.md`, is still reported, since pull never delivers anything there. The cross-skill link case in review-branch.test.ts gains a one-file sibling with four links: the SKILL.md link failed before the change.
The marketplace refresh lists each root skill folder as a plugin whose relative source is that folder. A skill kept as `skills/<name>.md` has no folder to name: the plugin format takes a relative source only as a directory inside the marketplace, and reads a skill only from a SKILL.md in a skills directory or at the plugin root. An entry pointing at the file would fail to install, so the refresh leaves such a skill out, as it already did. The comment at the scan now states that constraint, and the marketplace test fixture gains a one-file skill, so the exact output it asserts proves the skill stays out of the file.
… took nothing Mutation testing of InheritedFolders left the file order list --json and the dashboard show, and the boundary between a folder that took nothing from teamai's default and one that took files, unpinned. Proof: inherited-folders passes; the mutants that change the order or the empty check are now killed.
…mai's A copy's proof read one place in the team history. teamai remove and uninstall checked an agent folder's AGENT.md as a second proof, but pull's own checks (the tombstone pass, overwrite and stale copies) passed one origin and never looked at agents/**/<name>/AGENT.md, so a copy pull rendered from a removed agent folder stayed behind when its delivery record was lost. CopyOrigin now carries alternatives, other places a version of the copy comes from, each proved as the origin is. agentOrigin adds the agent folder, and the skill origin moves its one-file form, skills/**/<name>.md, from its own field to the same list, so every proof checks every place. Proof: a pull-tombstone case fails without the alternative (the rendered copy stays) and passes with it, and keeps a copy the member edited; the ownership, agents, skills, uninstall and pre-push-sync suites pass.
…ders are gone Uninstall removed <worktree>/.teamai/delivered/ but left the .teamai/ that held only it, an empty directory teamai created in the member's checkout. It now removes that .teamai/ too when nothing else is in it; a self-mode team, or anything the member keeps there, keeps it. Proof: the uninstall case for a remote team's delivered rule folders now checks .teamai/ itself; it fails before this change and passes after, and the self-mode case still keeps the team content.
…note in one place Rule folders and agent folders printed the same note from two copies of the sentence. folderFilesNote in the resolver now owns it, and the agent note calls it. Proof: the rule folder, resolver and agents suites, which assert the note verbatim, pass.
…tter included
The sync before push brought an unedited skill copy up to the team
version by copying the team files as they are, so a SKILL.md without
frontmatter, or a skill kept as one file, reached the tool without the
name and description pull writes, until the next pull. It now repairs the
frontmatter the way pull does.
Proof: the pre-push-sync cases now expect the copy pull delivers; the
first fails before this change ('v2 skill' without frontmatter) and all
pass after. The push and skills suites pass.
The Scorers page finds the values an older rubric listed by reading the scorer at the label's team revision, but it looked only for scorers/[<ns>/]<name>.md. Hand labels on a scorer folder's older rubric fell back to the values their labels stored, so judges could pair against the wrong rubric. The lookup now also reads scorers/[<ns>/]<name>/SCORER.md at that commit and hashes it with its support files the way pull does (CRLF as LF, hidden entries skipped), so a folder's rubric hash matches. The older-rubric pairing test now runs for a scorer file and for a scorer folder in a namespace; the folder case failed before this change.
Since scorer folders are read, push saw each file of
scorers/[<ns>/]<name>/ as a scorer of its own. The check that refuses
to place a file inside a scorer folder then fired on the folder's own
files: an edit of a team folder's support file, and every file of a new
folder, stopped the push. Had it gone through, --role would have left a
new folder at the shared root, because each file sat one level deeper
than a scorer file.
Push now reads a scorer folder's files as that folder:
- placement, the shared-root checks, open-PR destinations and the
folder check judge the folder, so a new folder lands whole in the
namespace --role or --project names, and a file of a team folder
goes back to it;
- a file added to a team folder is an edit of that scorer, not a new
one;
- a selection that takes only part of a folder is refused;
- placement refuses a destination that already holds a scorer of that
name in the other form, <name>.md or <name>/.
In self mode, a file the author adds to a folder an earlier push placed
goes into the placed folder.
Tests: push-role's --role case for a new folder, an edited and a new
support file of a team folder, and a partial selection; the placed-copy
case for a file added to a placed folder. Each failed before this
change. A real-CLI run on a git-mode team repo pushed a branch holding
scorers/ops/fresh/{SCORER.md,rubric.md} and the edited
scorers/strict/checklist.md. The same run before the change refused
both, and a second push found nothing to push.
The benchmark and scorer guides said a listed name needs a valid scorers/<name>.md. A scorer folder, scorers/<name>/SCORER.md, defines the name too: review --branch, pull and benchmark start check names against the scorers pull caches, and that cache holds folders. Both languages now name the folder, and the note on names with ":" says no scorer file or folder has one. The teamai-new-scorer lines keep scorers/<name>.md, since that workflow writes the file form. Documentation checks pass.
…s a file there A scorers/<dir>/ that no role or project declares is shared, so a scorer file there reaches every member, and review --branch says so. A scorer folder there, scorers/<dir>/<name>/SCORER.md, is handled the same way by both: pull caches it as a shared scorer, and review reports the same "sits at the shared root" note with the folder's SCORER.md as the path. These cases pin that. Both passed before any change, so this adds coverage, not a fix.
…scription A file directly under skills/ or a namespace folder became a skill, so notes teams keep there (NOTES.md, CONTRIBUTING.md, skills/docs/guide.md) reached every member as skills with a made-up description, and review --branch failed on them. Only README.md was left out, and teams keep other notes there too. A skills/[<ns>/]<x>.md is now a skill only when its frontmatter has a description, which review --branch already asks of every skill. Pull, push, review, remove and the dashboard read skills through one reader, and the search index and a ref change's removal names use the same rule. The namespace pull test now keeps NOTES.md and a CONTRIBUTING.md with other frontmatter beside a skill file; both were delivered as skills before this change. Fixtures that used a skill file without a description now give it one.
…ings For skills/<x>.md, review --branch reported skills/<x>.md/SKILL.md, a path that does not exist, and told the member to rename a directory. It now names the file and says to rename the file. The Agent Skills name test now holds a skill file; it printed the SKILL.md path before this change.
…and the skill file form The released notes still said a directory holding SCORER.md or AGENT.md is skipped, and listed none of what replaces it: a team folder over a teamai default inheriting the files it leaves out, agent and scorer folders, a skill kept as one file, the skipped-folders warnings going away, push refusing a file inside a folder of its type, and a default scorer being replaced by a file only. The breaking entries name what a team may trip over: a lone rules/teamai-recall/<x>.md now joins the recall rule, TEAMAI_AGENT_DIR is a reserved team env name, and a file under skills/ with a description is a skill. The sharing guide now says, in both languages, to upgrade every member before committing a partial override of the recall rule, since an older teamai reads such a file as an always-on rule of its own.
50226a8 to
389c3cd
Compare
|
All three are addressed in Notes under CHANGELOG — 389c3cd. Under Features: per-file inheritance, and agent and scorer folders. Under Changed: the removed skipped-folders surfaces and the one-time full sync, the push refusal, and the rule that a default scorer is replaced by a file only. Under Breaking Changes:
I also corrected the old line saying a folder with Review path for a one-file skill — 2f7fca8. Findings now name the file pull reads ( Not re-run here: HTTP mode, and CodeBuddy and OpenCode, which are left to CI as before. |
|
All three were real, and each is fixed with a test that failed first:
|
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Re-reviewed at 389c3cd6. The two blockers from the last round and the three points from the CI review are fixed. I rechecked them with a build of this head in a clean world:
skills/NOTES.md,skills/CONTRIBUTING.md,skills/docs/guide.mdand a file with a blankdescriptionstay notes.greet.md, a namespaceops/deploy.mdand a file with adescriptionbut nonameare delivered, andnameis filled in.- A
skills/<x>/SKILL.mdfolder is unaffected. review --branchraises nothing about the notes.- Deleting
greet.mdremovesgreeton the next pull. - A root
scorers/SCORER.mdis the scorerSCORERagain, cached asSCORER.json.
I read the index and merged-folder size fixes in the code, along with the team-ref removal naming and the push of a root agent shared with an inactive namespace's folder; they look right.
Two small edits left, both about the release notes:
[P1 blocking] The title needs !. The CHANGELOG now lists three breaking changes for this PR: the default-folder inheritance and recall <x>.md, TEAMAI_AGENT_DIR, and the skill file form. The title is still feat(resources): …. A breaking change needs both the CHANGELOG entry and the !, as #1804 did with feat(resources)!:, so the squash commit says so too.
[P1 blocking] CHANGELOG.md:12 still describes the behaviour this PR removes. In the same [Unreleased] section, the folders entry still says this release skips scorer and agent folders, that pull prints agents/reviewer/ is an agent folder, which this teamai cannot read yet, and that teamai status, teamai doctor and the dashboard list them. Line 70 now says those are gone, so the release notes contradict each other. Cutting that passage down to "SCORER.md and AGENT.md are reserved as well." resolves it. The line 145 fix was right.
[P3 nit] The try-scorer path still treats any file named SCORER.md as a folder, while pull now does that only below scorers/<dir>/.
CI was still running at this head when I looked: Windows and the budget checks passed, and nothing had failed.
The three earlier findings are resolved at their original sites: scorer cache identity, whole-repo skill indexing, and merged-workflow size validation. The PR description documents sufficient representative real-CLI testing. No testing-record finding. No PR code was run, built, or installed. |
…ard and when tried The dashboard's older-rubric reader and trying a scorer file still took any SCORER.md for a folder marker. For scorers/SCORER.md beside another scorer, the dashboard hashed the siblings into the rubric and dropped hand-label pairs, and trying the file read the whole scorers/ directory, failing on an unrelated symlink there. Pull, the dashboard and the try path now share one predicate, ScorerFolder.marks. Proven by a dashboard row and a try case that failed before the change.
|
Fixed in 6f8162d. Pull, the dashboard's older-rubric reader and the scorer try-out now share one check,
Checked in a world with the real CLI: |
The earlier findings are resolved for their reported scenarios. The PR description includes sufficient representative real-CLI testing, including at No PR code was run, built, or installed. |
…copy names it Removing a folder agent deleted its delivered folder before deciding which tool copies stay. A copy kept because the member edited it, or because git tracks it, then named a rubric that was gone. The delivered folder is now removed after the copies, and only when none of them was kept. Proven by the kept-copy case, which found the rubric deleted before the change, and a new case that removes the folder when no copy is kept.
Trying ./SCORER.md from inside a scorer folder handed the parser SCORER.md, whose folder is '.', so the try failed with 'the folder name must be a token'. A tried file sits in no team repo, so the directory it is in and its name now stand for its place in one, and diagnostics still name the path as given. Proven by a try case run from inside the folder, which failed before.
…rers ScorerFolder.marks looked at the parent directory's name, so a scorer folder named scorers at the scorers root read as the file-form scorer SCORER. It now takes a path in the team repo and keeps only scorers/SCORER.md as a file. Proven by a row in the naming case, which named it SCORER before.
…olders entry The same unreleased section now says pull reads scorer and agent folders and that the skipped-folders warnings are gone, so the folders entry no longer describes skipping them.
|
Both release-note points are done:
[P3] try-scorer and The same round also fixed 859b1fc: |
|
All three are fixed, each with a test that failed first:
|
Resolved: earlier root-scorer identity/readers, whole-repo skill indexing, merged-workflow size validation, current-directory scorer parsing, and edited/tracked agent-copy preservation. The PR description documents sufficient representative real-CLI testing; the older recorded head is not blocking. No PR code was run, built, or installed. |
Thanks. The title and One thing before I approve. The CI review's new P2 is real: [P2 non-blocking] The smallest fix that keeps the two in step is to prune the same way pull does. After the tool loop, read the copies in The CI review's |
…opy names it Removing a folder agent kept its delivered folder only when it kept a copy in a tool it writes to. A copy in a tool the member excluded is never touched, yet its folder was deleted under it. Remove now keeps each folder a file in any tool's agents directory names, excluded tools included, which is the rule pull's prune already applies (AgentFolders.namedBy). Proven by a case with the copy in an excluded tool, which lost the rubric before the change.
A tried file was placed by its last two path segments only, so
scorers/scorers/SCORER.md read as the file-form scorer SCORER: its support
files were left out and a rubric naming ${TEAMAI_SCORER_DIR} was refused.
A path below the current directory now keeps every segment.
Proven by a try case of that folder, which was refused before.
|
Both are fixed, each with a test that failed first:
|
The earlier findings are resolved for their reported scenarios, including excluded-tool copy preservation and trying the repo-relative The PR description documents sufficient representative real-CLI testing, including at |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving at e7ec0c59. The blocking points from the earlier rounds are resolved:
- Notes under
skills/stay notes. I checked this in a world built from the PR. - The CHANGELOG covers the released behaviour this PR changes, under breaking changes, and the title carries
!. remove agentsnow keeps an agent folder whenever any tool's copy names it, through the sameAgentFolders.namedBycheck that pull uses.
On the latest CI review:
- The namespace
scorers/payments/SCORER.mdcase doesn't reproduce. Discovery (scorerCandidates) treats a directory that holdsSCORER.mdas the scorer folderpayments, and never walks it as a namespace. So no file-form scorerSCORERexists in a namespace for the parser to misname, andSCORER.mdis reserved, as the CHANGELOG says. - [P3 nit] Trying a scorer from inside
scorers/scorers/with./SCORER.md, or trying a team's rootscorers/SCORER.mdfrom a directory above the team repo, still guesses the form from the trailing path. Neither holds this up.
|
Neither needs a change; reasons below.
|
Summary
A team changes only the files it means to change in a teamai default, and every kind of resource can be a file or a folder.
HOOK.yaml/RULE.md/WORKFLOW.yamlskills/[<ns>/]<x>.md, delivered as<x>/SKILL.mdSKILL.mdResources<x>.mdAGENT.md${TEAMAI_AGENT_DIR}<x>.mdSCORER.md${TEAMAI_SCORER_DIR}What else moved:
teamai-*folder that replaces no file of the default:pullwarns, names it, and keeps teamai's file.review --branchfails. Contracts (the recall rule, a hook default's keys and texts) are checked on the resulting folder. A refused result leaves the default in force whole.{source: "team", teamRevision, teamaiVersion}and isdefinition_mismatchon a machine whose teamai or team commit cannot rebuild it.list --jsonmarks each file's layer (teamaiorteam).skippedFoldersstill forces one full sync, so those folders are delivered on the first pull after upgrading.<path>/ holds <MARKER>, so the file would be one of its files, not a resource of its own.). A scorer folder pushes as one scorer.CopyOrigin.alternatives), anduninstallremoves a worktree's.teamai/once its delivered folders are gone.ruleFoldersis nowfolderReach, since rule and agent folders share it. The persistedruleFolderGrantskey is unchanged.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpasses (docs checks included)npx vitest run: 786 files, 23,940 tests pass. Related E2E (npm run test:e2e, 65 files, 519 tests) pass.Real CLI (worlds from
npm run verify:world)50226a8(teamai 0.22.0): rows 1, 2, 3, 9 and 10 re-run after the rebase, with the same reads and markers as below, and a second pull that synced nothing.Ledger: 11 LEAKS(tool state and dashboard files, as below) andLedger: 1 LEAK(home/.codex, where the setup copied the Codex sign-in).Final head
389c3cd(world built from it, git mode, workspace), the review fixes:skills/: the team repo holdsskills/payments/greet.md(with adescription),skills/NOTES.mdandskills/payments/CONTRIBUTING.md(no frontmatter).teamai pull:Synced 1 skills (1 new, 0 updated) new: greet; noNOTESorCONTRIBUTINGskill delivered.teamai review --branch noteson a branch adding them:0 fail, 0 warn, 6 info, exit 0.scorers/SCORER.mdat the scorers root: the scorer cache holdsSCORER.jsonbesidestyle.json.teamai-import-from-repothat is small on its own but over 1 MB once merged: pull refuses it (it holds 1063879 bytes, more than the 1048576 bytes (1 MB) a folder may hold) and the default stays in force.Ledger: 1 LEAK(home/.codex, the setup's copy of the Codex sign-in).Head
6f8162d(world built from it):teamai score --session <id> --source claude-code --scorer ./scorers/SCORER.md, with a broken symlinkscorers/gone.mdbeside it, givesSCORER from scorers/SCORER.md: styled (score 1, passed). Before the fix that file was read as a folder holdingscorers/and refused (gone.md is a symlink). The ledger lists Claude Code's own state only (home/.claude*,home/.cache).Head
73e768d(worlds built from it, workspace):draft/style/(a scorer folder holdingSCORER.mdandrubric.md),teamai score --session <id> --source claude-code --scorer ./SCORER.mdgivesstyle from SCORER.md: styled (score 1, passed).teamai pulldelivers.teamai/delivered/agents/reviewer/(AGENT.md,rubric.md) and the member commits.claude/agents/reviewer.mdto the project,teamai remove agents reviewer --forcewarnsKept <world>/project/.claude/agents/reviewer.md: this repository tracks it, so teamai does not delete it.Both the kept copy and the delivered folder its text names (…/.teamai/delivered/agents/reviewer/rubric.md) are still there afterwards.Ledger: 5 LEAKS:home/.codex(the setup's sign-in copy), the member's tracked copy with the folder it names, which uninstall keeps by design, and the project commit made for the check.Head
e7ec0c5(world built from it, workspace): afterteamai pulldeliversreviewer, the member'senabledAgentsbecomes[codex]so Claude Code is excluded.teamai remove agents reviewer --forcegivesRemoved 1 agents from 1 location(s)..claude/agents/reviewer.mdand the folder it names,.teamai/delivered/agents/reviewer/(AGENT.md,rubric.md), are both still there.Ledger: 1 LEAK(home/.codex).Acceptance table, 2026-11-12, worlds built from
f4a8ec7(the same code before rebasing ontomainand the two fixes at the end) (teamai 0.22.0, node v24.21.0, git 2.56.0). Tools: Claude Code 2.1.322 (claude -p --model haiku), Codex 0.167.1. Repo mode: git. Team repo:manifest/roles.yamlwith rolespaymentsandweb; the member ranteamai init https://teamai.test/team/repo.git --provider git --agent claude --role payments, thenteamai roles set web. Each support file holds a marker no other file holds.<world>is the world directory.rules/api-style/RULE.mdnaming${TEAMAI_RULE_DIR}/checklist.mdclaude -p "What name should a REST endpoint that lists invoices have? Follow the team rules."read <world>/project/.teamai/delivered/rules/api-style/checklist.md, no literal${. Transcript:Read {"file_path": "<world>/project/.teamai/delivered/rules/api-style/checklist.md"}. Reply ends withTOKEN-RULE-7Q2Read {"file_path": "<world>/home/.teamai/rules/api-style/checklist.md"}, reply ends withTOKEN-RULE-7Q2.~/.claude/settings.jsonadditionalDirectoriesholds~/.teamai/rulesand~/.teamai/agentscodex exec "…same prompt…"cat .teamai/delivered/rules/api-style/checklist.md, replyUse GET /invoices … TOKEN-RULE-7Q2codex may ask before it reads the files of user-scope rule folders in <world>/home/.teamai/rules (api-style). Session:cat <world>/home/.teamai/rules/api-style/checklist.md, reply ends withTOKEN-RULE-7Q2agents/reviewer/AGENT.mdnaming${TEAMAI_AGENT_DIR}/rubric.mdclaude -p "Use the reviewer subagent to review this snippet: function add(a, b) { return a - b }"Agent {"subagent_type": "reviewer"}. Inside it:Read {"file_path": "<world>/project/.teamai/delivered/agents/reviewer/rubric.md"}. Its review endsTOKEN-AGENT-4K8.claude/agents/reviewer.md:Read <world>/home/.teamai/agents/reviewer/rubric.md first…. Subagent read that file, review endsTOKEN-AGENT-4K8main(only tools withlegacyAgentMdread Markdown agents)skills/payments/greet.md(file form)teamai pull, thenclaude -p "Greet Alice."✔ [workspace] Synced 1 skills (1 new, 0 updated) new: greet;.claude/skills/greet/SKILL.mddelivered. TranscriptSkill {"skill": "greet"}, replyHello, Alice! … TOKEN-SKILL-9M3scorers/style/SCORER.mdnaming${TEAMAI_SCORER_DIR}/rubric.mdteamai score --session <A> --source claude-code --scorer style, then the same for<B>style: styled (score 1, passed), reasoningThe final answer 'Done. TOKEN-SCORER-2P5' contains the required token. B:style: unstyled (score 0, did not pass). Onlyrubric.mdholds the ruleworkflows/payments/release/(WORKFLOW.yaml+prompts/plan.md)teamai workflow start release --driver local --tools default=claude --sandboxoutcome: succeeded,plan succeeded {'answer': 'TOKEN-WF-PAY-5H1'}. web:✔ [workspace] Synced 1 workflow(payments got 2), and itsreleaseis the root's (row 6)workflows/release/at the root andworkflows/payments/release/WORKFLOW.yaml,prompts/plan.md=Set answer to the token TOKEN-WF-PAY-5H1.(no root file). web:plan succeeded {'answer': 'TOKEN-WF-ROOT-8C6'}, folder copy holds the root's two filesworkflows/review-run.yaml: a prompt step withagent: reviewer,workspace: newteamai workflow start review-run --driver local --tools default=claude --sandbox<world>/project/.teamai/workflow-worktrees/teamai-r…-review-p1-…. It read…/review-p1-…/.teamai/delivered/agents/reviewer/rubric.md. Outputreview: "Bug: … returns a - b … TOKEN-AGENT-4K8"benchmarks/payments/smoke/(SUITE.yaml, one task)teamai benchmark run smoke --sandbox| claude | claude | haiku (team) | 1 | 1 | 0 | … | 100% (1/1) |. web:benchmark_not_found: Suite "smoke" has no runnable version for this member.hooks/teamai-env-hint/variables.mdonlyteamai pull;claude -p "Quote, word for word, the sentence about team env variables that the session start gave you";teamai list hooks --jsonHOOK.yaml README.md README.zh-CN.md exec.md secrets-rule.md secrets.md variables.md. Session:Team env variables here (TOKEN-HOOK-3T9): PAYMENTS_API (Payments API endpoint).JSON:"source": "team, over teamai default 0.22.0 (1 own files, 6 inherited)",variables.md"layer": "team", the other six"layer": "teamai"hooks/teamai-env-hint/extra.mdteamai review --branch stray;teamai pullafter merging it✖ [structure] hooks/teamai-env-hint/extra.md replaces no file of teamai's default, so it is not used and teamai's files stay in force. …. Pull:⚠ hooks/teamai-env-hint/extra.md replaces no file of teamai's default …; delivered folder unchanged, noextra.mdPrompt steps that read
$TEAMAI_WORKFLOW_DIR(rows 5–7) run withpermissions: unattendedandrequires: { isolation: sandbox, strict: true }, started with--sandbox. Headless Claude otherwise asks before it reads outside the checkout (docs/guide/workflow-advanced.md, Unattended prompts). The world is a throwaway HOME.Ledger (
npm run -s verify -- ledger <run>): not CLEAN in any world. Claude workspace:Ledger: 21 LEAKS. Codex workspace:Ledger: 4 LEAKS. Claude and Codex user scope:Ledger: 9 LEAKS. Every leak is a tool's own state (home/.claude*,home/.codex,home/.cursor,home/.npm,home/Library), a workflow run's leftovers (project/.teamai/workflow-worktrees,workflow-hooks,refs/heads/teamai/…,.git/configworktreeConfig), an empty tool directory (project/.codex, like the known #1808project/.claude), or teamai's dashboard and usage files. None comes from a file this branch changes (git diff origin/main --statis empty for their writers). What this branch delivers is gone afterteamai uninstall:.teamai/delivered/,~/.teamai/agents,~/.teamai/rules,.claude/agents/reviewer.md, and every skill includinggreet.Hit every surface
TOOLS(folderReach). Tools that can't read a user-scope folder get a warning naming the directory. CodeBuddy and OpenCode are left to CI..teamai/<kind>/folders the same way (unit tests); not run in a world, which cannot set it up. HTTP mode installs one downloaded.mdper agent, as onmain, so agent and rule folders do not reach HTTP members. Unchanged.projectRoot; not exercised.pull,push,review --branch,list,status,score,workflow start,benchmark run,uninstall; the session-start hook (row 9); the dashboard (skipped panel removed, improvement page reads skills throughResources).uninstallremoves delivered folders and the emptied.teamai/; ref switches name every form when they find removals.skippedFoldersrecord syncs in full once.skill-data/:sharing.md,scorers.md,workflow.md,dashboard.mdand others (EN and zh-CN),skill-data/core/references/troubleshooting.md, the glossary (Marker file,teamai default), and generated tool-support pages.Notes for Reviewers
e7ec0c5and report no growth againstmain.scorers/teamai-<default>/SCORER.mdis refused with a warning that names the file form, and teamai's default keeps running (documented indocs/guide/scorers.md). A default scorer's replacement may read only the variables the default offers (src/default-scorers.ts). Its rubric is filled into generated questions (routing, adoption, benchmark correctness) whose pins and frozen benchmark plan carry text only.sourceHashand definition hash both match. The hash covers every file, inherited ones included. The teamai version check guards the rebuild from the team commit, which lacks the inherited files.descriptionin its frontmatter; any other.mdunderskills/stays a note.TEAMAI_AGENT_DIRis now a reserved variable. A team folder named like a teamai default now takes every file it leaves out from the default; have every member upgrade before committing a folder that holds only some files, since an older teamai readsrules/teamai-recall/block.mdas a rule of its own (CHANGELOG.md, Breaking).list workflowsshows a namespace's workflow aspayments/release (not runnable)in the team repo listing. It does the same onmain.