Repository navigation
ci(lint): enable the anti-slop lint rules, and fix the 23 bugs they found - #1664
Conversation
|
No confident findings in the specified PR diff. The PR description documents sufficient testing: lint, typecheck, unit tests, build, and representative real-CLI verification, including malformed hook-file cases. Deferring the full E2E suite and provider × agent matrix to CI is permitted by the review rules. I only read the diff and trusted base criteria; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
The new rules are fine. This review looks for regressions, since the PR is mostly a cleanup. It covers the whole diff read with git diff -w --ignore-blank-lines against 02b8e9f6. Most hunks are behavior-preserving rewrites. A few sites change behavior that the PR does not list, and CI is red.
[P1 blocking] Lint & Test fails on Node 20
Lint & Test (Node 20 on ubuntu-latest) fails with 396 failures in oxlint-plugin-teamai/anti-slop.test.ts, every one with:
Error: `RuleTester` is not supported on 32-bit or big-endian systems, versions of NodeJS prior to v22.0.0…
The vendored upstream rule tests use RuleTester from oxlint/plugins-dev, and that needs Node 22. The package supports Node 20 and the CI matrix runs it, so this job stays red. Node 22 and 24 pass. Two possible fixes: skip that suite below Node 22 (describe.skipIf(Number(process.versions.node.split('.')[0]) < 22) around the imports), or run the anti-slop cases through ruleHarness like the other teamai/* rules.
The same job also failed workflow-local-driver.test.ts › "'cancel step then retry' never overlaps live attempts at max_parallel 1" (code: 'busy' instead of done). This PR does not touch that test or src/workflow/local-driver.ts, so it looks like timing flakiness. A rerun should confirm.
[P2 non-blocking] Files written with a new key order that the PR body does not list
The body says files teamai writes keep the same bytes, except the listed local files. Three more files are rewritten in schema key order, because a z.looseObject emits schema keys first. Values do not change.
src/resources/secrets.ts:107readSecretsForEdit: re-parsing every entry reorders the team's committedsecrets.yamlon each declare or remove, which makes a noisy diff in the team repo. Keeping the file's own order fixes it:isJsonObject(entry) ? [{ ...entry, ...declaration.data }] : [].src/workflow/records.ts:613MemberStatsSchema:stats/<user>.yamlon the reports branch is rewritten withusername/workflowsfirst.src/models/switch.tsloadManifest: every untouched agent entry in~/.teamai/models/managed.jsongetsfilePathmoved beforepreviouson the next save. A falsypendingkey, which the old loader kept, is now dropped.
Either keep the old order or add these to the "Behavior changes" table.
[P2 non-blocking] for_each over a null value now says "gives a null"
src/workflow/fan-out.ts:39 kindOf: a null value now falls through to jsonType(null) and prints a null. Before, it printed null. A missing path resolves to null, so this is the common failure case, and the text is stored in the run file. Fix:
if (value === undefined || value === null) return 'null';[P2 non-blocking] Bug 1 is fixed in agy-hook-io.ts but not in src/bridged-team-hooks.ts
src/bridged-team-hooks.ts:209 still does bridge.tools[toolName] ?? toolName on the object literals in BRIDGES. For OpenCode, OMP, Pi, OpenClaw, Kiro and Hermes, a tool named constructor or toString loses tool_name, and __proto__ becomes {}. The same Map change as in agy-hook-io.ts fixes it.
[P3 nit] Smaller unlisted behavior changes
- A hook payload with a numeric literal that overflows to
Infinitynow fails the stdin schema, and the whole payload reads as{}. copilotRunsEntriesand the shell copyCOPILOT_RUNS_ENTRIES_SOURCEnow disagree on an entry whosematcheris not a string.- Some readers now drop a whole list for one bad element, and the next write persists the empty list: the
votes/deltasmap in v2 votes files, components in_manifest.json(rebuild-wiki-index.ts),ingestedMrsin the source manifest, andmr-hint.ts. local-agent.ts: a missingcreatedAtis filled with the current time. A workspace binding with a non-numberprojectIdis dropped, then deleted on save.utils/yaml.tslogLevel: 'error'also hides unrelated warnings, such as an unresolved custom tag in a member-edited file.- Bugs 13, 14, 15, 18, 19, 20, 21 and 22 have no regression test.
Checked and unchanged
- Every error-message rewrite prints
e.messagefor anError, as before. - No test was weakened, and no existing
teamai/*rule was narrowed. - The vendored anti-slop rules match the upstream commit named in
UPSTREAM.md. website/, tsup and vitest config changes are blank-line only, apart from the vendored-tests exclusion.- There are no workflow,
package.jsonor lockfile changes.
CI review reported no findings. The macOS Lint & Test and the E2E shards were still running when this was written.
|
No confident findings in the specified PR diff. The PR description documents sufficient testing: lint, typecheck, unit tests, build, and representative real-CLI verification, including malformed hook-file cases. Deferring the full E2E suite and provider × agent matrix to CI is permitted by the review rules. I only read the diff and trusted base review criteria; I did not run, build, or install PR code. |
|
No confident findings in the specified PR diff. The PR description documents sufficient testing: lint, typecheck, unit tests, build, and representative real-CLI verification, including malformed hook-file cases. Deferring the full E2E suite and provider × agent matrix to CI is permitted by the review rules. Earlier passes raised no findings, so none require resolution. I only read the diff and trusted base review criteria; I did not run, build, or install PR code. |
The blocking finding is fixed in 59f8a62: the vendored anti-slop suite now runs on Node 22 and 24 only, and CI is green at e0b8be7. Since #1663 landed, the branch conflicts with main and needs a rebase. The non-blocking points from the review are still open: the three files rewritten in a new key order, the "gives a null" message, and the |
e0b8be7 to
3055eae
Compare
|
No confident findings in the specified PR diff. The PR description documents sufficient testing: lint, typecheck, unit tests, build, and representative real-CLI verification, including malformed hook-file cases. Deferring the full E2E suite and provider × agent matrix to CI is permitted by the trusted review rules. Earlier passes raised no findings, so none require resolution. I only read the diff and trusted base review criteria; I did not run, build, or install PR code. |
Thanks for the rebase. #1658 is about to land, and this branch conflicts with it in more than 20 files ( |
…ression reasons Issue Tencent#836 leaves the anti-slop rules as its last open lint item. This vendors every generic rule of dmmulroy/anti-slop (MIT) into the repo's one lint plugin, as the upstream README recommends; they report as teamai/<rule> and hold production code, not tests. oxlint imports plugins with plain Node and CI lints on Node 20, so index.js loads the TypeScript rules through scripts/typescript-loader.mjs. The rules the code already passes are on now: no-module-mocking, no-reduce-accumulator-copy, no-reflect-apply, no-reflect-get, no-unknown-type-aliases, no-widen-then-assert, and oxc's no-accumulating-spread. The one production Reflect.get, in src/workflow/snapshot.ts, now reads the field from the value's own entries. The commits after this one fix each remaining rule and turn it on. teamai/suppression-reason, adapted from t3code's require-suppression-reason, fails a lint or TypeScript suppression that does not say why, as CONTRIBUTING already asks; the 14 without a reason now have one. The other t3code rules depend on Effect, React or the mobile app. Tested: npx vitest run oxlint-plugin-teamai (upstream rule cases plus the suppression-reason cases); the workflow snapshot tests pass; npm run typecheck; npm run lint, and oxlint on Node 20.19.5 loads the rules.
… for
`oxlint --fix` with only this rule on, over production code: blank lines
between top-level declarations, around multiline bindings, before
returns and control flow, and after blocks. Eight files had one-line
blocks such as `{ const parsed = X.safeParse(line); return ...; }` that
the fix would split mid-line, so those blocks are written out on separate
lines first. `git diff --ignore-blank-lines -w` shows only those eight.
Tested: npm run lint; npm run typecheck; npm run build; npx vitest run
(646 files, 20,399 tests).
The votes file was read with `as unknown as` casts and hand typeof checks on its ride-along fields (upvote ledger, pending delivery record, delivered sync ids). The v1 and v2 file types are now zod schemas in types.ts and the file is parsed once where it is read: a malformed ride-along reads as absent, a corrupt counter reads as 0, and unknown keys are kept on save. Proof: votes-related unit tests (44 files, 1353 tests) pass; tsc passes.
HandDeclaredNamespacesShape is spread into the roles and projects resources schemas; the name said its structure rather than its role. Proof: tsc passes.
Modules that hold parsed JSON or YAML before a domain schema narrows it typed it as Record<string, unknown> or unknown; JsonValue (zod's z.json()) gives them one named type to share. Proof: tsc passes.
Shared inputs were read through casts and typeof checks in every caller. Frontmatter gets a value type, fs exports errnoCode, and types.ts gains HookPayloadSchema plus named types for its tables and resolutions. Proof: frontmatter, fs-atomic-mode, fs-compare, tool-roots, webhook and webhook-formatters tests pass; tsc and lint on the batch report no hits.
The cwd, session id and tool-call helpers hand-checked each stdin field. They now parse the payload once with the shared schema; a malformed field still reads as absent. Proof: hook-cwd, session-id, tool-call, hook-handlers and recall-attribution tests pass; tsc and lint on the batch report no hits.
… with schemas Frontmatter fields, vote files and the reusable cache entries were cast and checked with typeof. Schemas now keep the same accepted inputs and skip the same malformed entries. Proof: search-index, search-index-drop-all, search-index-incremental, search-index-learnings-roots, search-index-local-votes, search-index-multi, search-index-read-order, search-index-scoring and search-index-unreadable tests pass; tsc and lint on the batch report no hits.
… of casting GitHub, GitLab, GitCode, TGit and CNB responses were cast to their expected shapes. Each is parsed with a schema; optional fields that were skipped when malformed still are, and error messages are unchanged. Proof: gh-org, gh-org-errors, github-provider, github-mr-fetch, import-mr, workflow-pr-providers, gitlab-*, gitcode-provider, tgit-*, cnb-* and exec tests pass; tsc and lint on the batch report no hits.
…sting tags.yaml, the import lock, the cache index, the partition config and iWiki replies are parsed with schemas that read the same fields the casts did. Error messages come from instanceof checks, and conditional spreads are built in statements with the same key order. Proof: branch-worktree-*, git, git-binary, jsonl-store, iwiki-*, redact, tags, import-lock, cache-*, partition, push-pending-pr, placement-records, learnings-*, reports-*, shell-profile, team-history, tool-names and local-agent tests pass; tsc and lint on the batch report no hits.
…f casts Machine settings were read through hand-written typeof checks and Record<string, unknown> casts. A loose mapping schema now gates each level, member-setting keys come from the schema, and overlays are built in statements, so the same files load to the same settings. Proof: config-*, member-settings-overlay, init and pull tests pass; tsc and lint on the batch report no hits.
…of casting Skip reasons, delivered blobs and pre-placement paths were read back with typeof checks and written through casts. A PushItem type names them, the teamai.yaml packages check parses a mapping, and error messages use the instanceof form the file already uses elsewhere. Proof: push-* tests pass; tsc and lint on the batch report no hits.
reportedSegments re-validated each snapshot field with typeof. Stored segments now go through a schema whose per-field catch keeps the old zero and false fallbacks, and delta helpers return inferred or named types. Proof: team-push-* and pull tests pass; tsc and lint on the batch report no hits.
… casts Checkout records, place selections and delivery selections were assembled with conditional empty-object spreads. They are built in statements that add each field only when present, and the registry handler casts live in three helpers that state why each holds. Proof: pull-* and post-pull tests pass; tsc and lint on the batch report no hits.
The salvage of an invalid config, the local-agent manifest and hook files were read through casts and typeof checks. Each is parsed with a schema that skips what the old code skipped, and config objects are built in statements that keep the key order init writes. Proof: init*, uninstall and pull tests pass; tsc and lint on the batch report no hits.
…sors program.opts() and optsWithGlobals() take the option type as a type argument, so the casts on each action go away. Option help is unchanged. Proof: index-* tests and check-docs pass; tsc and lint on the batch report no hits.
…d of casting The ownership manifest, each agent's settings file and the recorded snapshots are now parsed with zod at the point they are read, so the writers take typed values and the hand-written record checks and casts go away. Error messages, accepted files and written bytes stay the same. Proof: model-switch, codebuddy-relocated-models, pull-agent-models, agent-model-aliases and doctor-agent-models tests pass; tsc and lint on the file report no hits.
…lies in statements Tool events are parsed with zod field by field instead of narrowed with typeof and casts, and readings, reports and launch env are assembled without conditional empty-object spreads. Readings and reports keep the same fields. Proof: tool-launch-call, tools, scorers-judge, scorers-judge-model, votes-judge and workflow-local-tool-adapter tests pass; tsc and lint on the files report no hits.
The benchmark suite, plan, trials, results, history and table code that main added parses what it reads with schemas and builds what it writes in statements, through definedFields, which keeps key order and leaves undefined fields out. isLabelShaped is now isRecordableLabel, beside isRecordableName. Checked: npm run typecheck, npm run lint; benchmark, dashboard-benchmarks, push-file and session-to-task tests pass; a harness running main's code and this branch on the same suites, plans, records and tables gave the same output.
…de main changed The rebase onto the benchmark workflow change kept main's side of each conflicting workflow file. This merges the branch's schema parsing and statement-built objects back into them, keeps every new field of main in the position main writes it, and fixes the hits in the new code. The run file a handoff claim installs and the workflow cache keep main's key order. The two docs-check tests that run it three times keep their 60s timeout. Checked: npm run typecheck, npm run lint, the full unit suite (678 files), npm run build.
3055eae to
7c582e1
Compare
|
All items from the review are handled on the current head. Each fix has a test that fails without it. [P1] Node 20. Fixed in 9c33f1d. [P2] Key order. Fixed for all three files. Each now spreads the parsed value over the entry it was read from:
The falsy [P2] [P2] Bridged tool names. Fixed in [P3] Smaller items.
|
|
No confident findings in the specified PR diff. The PR description documents sufficient testing, including build, lint, typecheck, unit tests, and representative real-CLI verification with malformed hook-file cases. Deferring the full E2E suite and provider × agent matrix to CI is permitted by the trusted review rules. Earlier passes raised no findings, so none require resolution. This was a read-only review; I did not run, build, or install PR code. |
…fore pulling in the clone The hook's background pass pulls too. On a slow runner it still held the sync lock when the test's own pull ran, so that pull was skipped and exited 1. Reproduced by delaying the test's pull and holding the lock in the background pass; waiting for the hook's detached children passes under the same delays.
…r runs The deadline counts from the start, and 15s left the plan, the baseline and the claude trial no margin: on a slow runner the check reported after it and was cancelled. 40s passes with 3s added to every workflow call, which fails at 15s.
The PR description documents sufficient testing, including build and representative real-CLI verification. Deferring the full E2E suite and provider × agent matrix to CI is permitted. Earlier passes raised no findings, so none require resolution. This was read-only; I did not run, build, or install PR code. |
gray-matter returns the YAML root as it is, so frontmatter such as `- tag` is a list. The learning frontmatter schema refused it, and the whole workspace index failed to build, so recall found nothing. It now reads as no metadata and the body is indexed, as before. Checked with a learning holding `---\n- ops\n---`: recall printed "could not build the workspace search index" before, and now gives the same transcript as main.
|
Fixed in bc734ae. The impact was larger than a P2: with one learning whose frontmatter was
|
|
No confident findings in the specified PR diff. The earlier The PR description documents sufficient testing, including build and representative real-CLI verification with malformed hook files. Deferring the full E2E suite and provider × agent matrix to CI is permitted. This was a read-only review; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving at bc734ae. Every finding from the earlier review is resolved:
- Node 20: the vendored rule tests run on Node 22 and later, and report a skip below that.
- Key order:
secrets.yaml,stats/<user>.yamlandmanaged.jsonkeep their own key order and every key. A script against the locked zod and yaml versions confirmed this. for_eachover null: it says "gives null" again.- Bridged tool names:
bridged-team-hooks.tsmaps only names its table has. - Lists: they skip only the bad entry.
parseYaml: it prints every warning except the YAML 1.1 tag ones, each exactly once.- List-form learning frontmatter: it is indexed with no metadata again, as on main.
I accept both declines, the falsy pending and the non-number projectId. The second is now in the Behavior changes table.
The rebase onto #1658 keeps its behavior: the token meter's message_delta merge, the workflow finally/from handling, and push --file/--path.
The two E2E fixes are test-only:
- the suite deadline gets room for the trial the driver runs;
- the clone pull waits for the hook's background pull. Main fails that one too.
CI is green at this head.
[P3 nit] src/models/switch.ts:238: the pending.prior entry in managed.json still comes back in schema key order. It only matters when recovering from a switch interrupted between two saves, and values do not change.
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Before merging, I ran two more regression passes on bc734ae. Replacing my approval with this one finding.
Built-CLI comparison with main. The same 122 commands ran against main and this head, and every difference is a fix the PR lists:
- init, pull, status, doctor, recall and every
--help; envand secrets;- hook dispatch, including malformed payloads;
- a workflow with
for_each; - broken hook, settings,
managed.jsonand local-agent files.
Code sweep. It read every new .parse on data from outside teamai. It found this:
[P1 blocking] One mcp_tool hook makes Codex hook trust fail
src/codex-trust.ts:74-80 and :475-483: HookInfoSchema requires a command string, and listHooks throws AppServerError when any listed hook fails it. Codex 0.166.0 lists mcp_tool hooks with handlerType: "mcpTool" and no command. I captured this from a real codex app-server hooks/list reply, using a hooks.json that holds one command hook and one mcp_tool hook. Main returned both hooks and trusted teamai's own.
So for a member who has their own mcp_tool hook, this head behaves differently from main:
- every
teamai pullfails to trust teamai's Codex hooks, so Codex does not run them; - moved hooks lose their approvals, with only a warning;
doctorreports that it could not ask Codex.
It is not in the Behavior changes table. Prompt and agent hooks will take the same path once Codex supports them; it skips them today.
Fix: read each listed hook on its own and drop the ones that do not match, the same tolerance lenientList gives elsewhere. For example z.array(HookInfoSchema.nullable().catch(null)) and then filter the nulls. codex app-server generate-json-schema --out <dir> writes the reply schema (v2/HooksListResponse.json) to check against. A unit case with an mcpTool entry would pin this down.
[P3 nit]
agent.yaml: atool_extrasvalue that is not a map from tool name to fields now makes pull skip the agent. Main delivered the agent and ignored the bad value. Not in the Behavior changes table.- Session archive
meta.jsonwith a field missing now drops out of index rebuilds and moves, and fails a restore. Every teamai version writes those fields, so only a hand edit triggers it. - When pull refuses a hook file,
doctorstill suggeststeamai hooks inject, which refuses the same file. The pull warning ("Fix it, then run the command again") is the one that helps.
…command Codex 0.166 lists an mcp_tool hook with no command. hooks/list was read as one strict list, so one such member hook made every trust pass fail: pull left teamai's Codex hooks untrusted, moved hooks lost their approvals, and doctor could not ask Codex. Each listed hook is now read on its own and one without the fields teamai matches on is skipped; teamai writes only command hooks. The codex-trust case with a member mcp_tool hook trusted nothing before and trusts every teamai hook now.
…rewrite
doctor told the member to run `teamai hooks inject` for a hook file whose
events are not lists, but inject refuses that file as pull does. The check
now gives pull's message, which names the file and the problem.
The doctor CLI case with `hooks.SessionStart: {}` gave the inject hint
before and gives pull's message now.
|
@SaulMoro all four items are handled on 310b390. [P1]
[P3] [P3]
|
|
No confident new findings in the specified PR diff. The earlier The PR description documents sufficient testing, including build and representative real-CLI verification with malformed hook files. Deferring the full E2E suite and provider × agent matrix to CI is permitted. This was a read-only review; I did not run, build, or install PR code. |
The Codex #1665 has landed, and this branch now conflicts with it in 17 files. Please rebase onto main and fix the anti-slop hits in #1665's code, as you did for #1658. This lands next, before #1666, which will rebase onto both. |
Brings in Tencent#1665, which moved the benchmark check into src/workflow/check.ts and check-run.ts and added scoring stages before the judge. Its new code is written to the anti-slop rules: conditional spreads became assignments, with the key order of every serialized object as main has it. Checked: typecheck, lint, the unit suite (677 files, 21273 tests), and the E2E files of the scorers and the benchmark, including main's new score-delivered-run test (6 files, 58 tests).
|
No confident new findings in the specified PR diff. The earlier The PR description documents sufficient testing, including build and representative real-CLI verification with malformed hook files. Deferring the full E2E suite and provider × agent matrix to CI is permitted by the trusted review rules. This was a read-only review; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving at 1e259ff.
- The Codex
mcp_toolregression is fixed in c473de7.listHooksskips a hook it cannot read, so teamai's hooks are trusted beside a member'smcp_toolhook, as on main. doctornow names the fix pull gives for a hook file it will not rewrite (310b390).- The merge of main (1e259ff) keeps everything #1665 added: on-demand scoring judges the other scorers before it returns an error, the stage order is check, CI, protected paths, then judge, and CI reading,
decidedBy,evidenceHashand the dashboard view are unchanged. It adds no schema to #1665's code. - I accept the two kept nits (
tool_extras, sessionmeta.json); both are now in the Behavior changes table.
Before this approval, a built-CLI comparison with main ran 122 commands, including corrupted hook, settings, secrets, frontmatter and local files. Every difference is a fix this PR lists. CI is green at this head.
Merging this one now. It is an important cleanup, and few pull requests are open right now, so landing it causes the fewest conflicts. #1666 rebases on top of it. |
Main enabled the anti-slop rules (Tencent#1664) while this branch was open. Blank lines go where require-readable-spacing asks, optional fields are left undefined instead of spread in from an empty object, a learning's session is read with a schema instead of typeof, and a suite task parses with parseYaml. npm run lint, npx tsc --noEmit, npx vitest run (21310 pass) and the e2e files for the team workspace, the self-improvement guide, PR delivery, git conformance and push --file (55 pass) are green.
Main enabled the anti-slop rules (Tencent#1664) while this branch was open. Blank lines go where require-readable-spacing asks, optional fields are left undefined instead of spread in from an empty object, a learning's session is read with a schema instead of typeof, and a suite task parses with parseYaml. npm run lint, npx tsc --noEmit, npx vitest run (21310 pass) and the e2e files for the team workspace, the self-improvement guide, PR delivery, git conformance and push --file (55 pass) are green.
Main enabled the anti-slop rules (Tencent#1664) while this branch was open. Blank lines go where require-readable-spacing asks, optional fields are left undefined instead of spread in from an empty object, a learning's session is read with a schema instead of typeof, and a suite task parses with parseYaml. npm run lint, npx tsc --noEmit, npx vitest run (21310 pass) and the e2e files for the team workspace, the self-improvement guide, PR delivery, git conformance and push --file (55 pass) are green.
Summary
Closes #836.
Turns on the last open item of #836, the anti-slop rules, plus two comment rules and a YAML rule. They run as part of
npm run lintfrom this PR on, in the repository's one plugin,oxlint-plugin-teamai. Every hit in production code is fixed in this PR. There is no baseline and no suppression without a reason. Fixing the hits turned up 23 bugs, listed below.#836 planned the rules one at a time, each starting as a warning count that must not go up. This PR turns them all on at once and fixes every hit instead, so nothing is left as a follow-up.
What lint checks now
teamai/no-unknown-parameters,no-unknown-returns,no-runtime-typeof,require-safety-comment-for-type-assertion,no-conditional-empty-object-spread,require-readable-spacing, …13909c9e, vendored unchanged (MIT) inoxlint-plugin-teamai/anti-slop/unknownpassed around instead of parsed,typeofnarrowing of file or API data, a cast with noSAFETY:note,...(x ? { k } : {})teamai/suppression-reasonoxlint-disable/@ts-expect-errorthat does not say whyteamai/no-low-value-commentsteamai/yaml-parseYAML.parseoutsidesrc/utils/yaml.ts, since it turns!!set,!!binaryand!!timestampinto a Set, Buffer or Dateoxc/no-accumulating-spreadEvery rule is an error. Tests are exempt from the anti-slop rules, because they build partial and malformed values on purpose. As the anti-slop install steps ask, lint skips the agent tooling directories a member's tools put in the checkout (
.claude/,.cursor/,.agents/, …)..github/CONTRIBUTING.mdshows what a hit looks like and how to fix it:A cast that stays says what checked it:
Bugs fixed (23)
Each was found while fixing a hit, on input that a member hand-edits or another tool writes. Every bug is in
maintoday. Bugs 1–3, 13–15 and 18–23 each have a regression test that fails on main.Names and null files (3)
constructor(ortoString,__proto__)[Function Object]docs/a&constructor;b.mddocs/afunction Object() { [native code] }b.md&constructor;is kept as written.claude-plugin/marketplace.jsonthat isnull, or lists anullpluginCannot read properties of nullMember-edited and foreign files read without trusting their shape (8)
"Stop": {})teamai pullwarnedFailed to reconcile hooks for claude: existing2.filter is not a functionand delivered no hooks for that toolteamai hooks listorstatusentries.some is not a functionmissinghooks.jsonwhose event is not a list, or whosehooksis not an objecthooks.jsonwith anullgroup, or an event that is not a list, during hook trustgroups.findIndex is not a functionshell-hooks-allowlist.jsonwith anullapprovaleventpackage.jsonwith"packageManager": 1split is not a function~/.teamai/local-agent/config.jsonwith"endpoint": 1endpoint.trim is not a functionstats/<user>.yamlwhose skill entry isnullcountin stats, team push, digest and pullOther hits that were bugs (12)
(e as Error).messagesitesundefined;pushthrew again on.message.replaceString(e)constructor,toStringor__proto__Objectbuilt-innullline inpending-review.jsonlmr-hint)undefinednull, or whosecommandis a numberFailed to reconcile hooks for claude: Cannot read properties of null/cmd.includes is not a function, and no hooks for that toolundefinedas the commandsize_bytesNaNmanifest.jsonwith anullscopeteamai uninstallstopped withCannot read properties of null (reading 'rules')before it removed the local agent's rulesdomain(enrich-with-ai)constructor,toStringor__proto__in a hook payload bridged for OpenCode, OMP, Pi, OpenClaw, Kiro or Hermesconstructorlost itstool_name, and__proto__became{}Behavior changes
Files teamai writes give the same bytes as before, except the local files listed in the last row. The checks for that:
secrets.yaml,stats/<user>.yamlon the reports branch and~/.teamai/models/managed.json.The other changes affect only input that teamai does not write.
hooksisnull!!set,!!binary,!!timestampor!!omapagent.yamltargetsortool_extras(not a map from tool name to fields),_overlay.jsonor_dirs.jsontool_extraswas dropped, or spread into the tool's fileconfig.jsonwhoseprojectIdis not a numbermeta.jsonmissing a field every teamai version writes (a hand edit)index.json, WorkBuddy session metadata, the workflow cache'steamRevision,skill.json's orchestrator, claim run files, session labels, the scorer cache pin,git-exclude-notices.jsonfirstTs, which readers already took fromtsReview guide
The diff is mostly mechanical, and
-w --ignore-blank-linesdrops therequire-readable-spacingblank lines:That is 478 files, +20.9k / -8.4k, plus 5.1k lines of vendored rules. Each commit holds one rule, or one area for one rule, and its message says how it was checked. The
fix:commits are the bugs above.Evidence
On the head of this branch:
Two E2E tests from main that failed on a slow runner are fixed here too. The first also fails on main's own CI. Both are test-only changes, and each was reproduced with a delay added to the built CLI, which was then rebuilt without it:
benchmark-team-assets"resolves the clone's own install from a subdirectory…"teamai pullwas skipped and exited 1benchmark-driver-contract"…the suite timeout settles the other not_run"lease_cancelled)teamai workflowcall: red at 15s, green at 40s (56s)The same member session, run with the built CLI of
main(8a84704) and of this branch, in a fresh HOME against a local team repo. The commands:init --agent claude --scope project,pull,status,list mcp,list skills,env list,doctor,hook-dispatchSessionStart / UserPromptSubmit / PostToolUse / Stop,recall flaky test,stats,pull,uninstall --force.A member with their own Codex
mcp_toolhook, with Codex 0.166.0 (init --agent codex --scope user,pull,doctor): main and this head both printTrusted 8 teamai hook(s) in CodexandCodex trusts the teamai hooks, and their transcripts are the same apart from timings and hashes.The malformed Claude hook files from the table above, one
teamai pulleach, with the same two builds:hooks.SessionStartin~/.claude/settings.json{}Failed to reconcile hooks for claude: existing2.filter is not a function…/settings.json: hooks.SessionStart is not a list, so teamai left the file as it is. Fix it, then run the command again."x"existing2.filter is not a function[null]Cannot read properties of null (reading 'description')Updated teamai hooks, and thenullentry is kept[{"hooks":[null]}]Cannot read properties of null (reading 'type')Updated teamai hooks[{"matcher":1,"hooks":[{"command":2}]}]cmd.includes is not a functionUpdated teamai hooksNot covered here:
RuleTesterdoes not run on Node 20. Lint itself and the repository's rule tests run on Node 20 too.teamai/no-module-mockingis on but cannot fire, because it only matchesvi.mock/jest.mock, and tests are exempt.no-known-value-wideningandno-unsafe-dictionary-typeflag a type alias declared in the same file, but not the same alias imported from another file. They are left unchanged from upstream.Merge Danger
Door: two-way. Every change is in code and lint config, and nothing migrates a file. A revert brings back the casts and the crashes above.
Blast Radius: wide. About 440 production files change, mostly by moving casts and
typeofchecks to schemas where files are read. Teamai's own writes give the same bytes. Input that teamai does not write may now read as absent, or be refused, where it used to pass through or crash. A new production file needs to pass these rules before it merges.