Repository navigation
feat(platform): show who created and last edited a skill - #3786
Merged
Merged
Conversation
The editor's save checks a team skill's teams against the organization and, for a non-admin, against the saver's own teams. Neither upload door did: a member could upload a zip whose SKILL.md shared the skill with a team they are not in, or with an id that is no team at all, and an automation package wrote its carried skills verbatim — declared owner, sharing and all — so a package could install a skill in another member's name. Both doors now write through one step, prepareBundleWrite: the owner and private-retired rules normalizedBundleFiles already applied to zips, then the team-audience rule, checked when the team list is new or changed (an unchanged re-upload never fails on a team deleted since). The package lane judges each carried skill as it would be written, so re-uploading an unchanged package still reports its skills as unchanged, and it checks every team before writing any skill. The package door answers team refusals with the skill door's codes (TEAM_NOT_IN_ORG, TEAM_ACCESS_DENIED).
The editor's save checks a team skill's teams against the organization and, for a non-admin, against the saver's own teams. Neither upload door did: a member could upload a zip whose SKILL.md shared the skill with a team they are not in, or with an id that is no team at all, and an automation package wrote its carried skills verbatim — declared owner, sharing and all — so a package could install a skill in another member's name. Both doors now write through one step, prepareBundleWrite: the owner and private-retired rules normalizedBundleFiles already applied to zips, then the team-audience rule, checked when the team list is new or changed (an unchanged re-upload never fails on a team deleted since). The package lane judges each carried skill as it would be written, so re-uploading an unchanged package still reports its skills as unchanged, and it checks every team before writing any skill. The package door answers team refusals with the skill door's codes (TEAM_NOT_IN_ORG, TEAM_ACCESS_DENIED).
Before carried skills followed the owner rule, the package lane wrote their SKILL.md as the package carried it, usually with no owner. The plan compared the stored bundle only with the owner-stamped rewrite, so re-uploading the same package no longer matched: a Developer, who cannot edit an ownerless shared skill, was refused, and an Admin got an overwrite prompt whose confirmation silently adopted the skill. A stored bundle that still equals the carried files byte for byte now counts as unchanged too, since nothing on disk would change. The refusal for a differing bundle no longer claims another member owns the skill, which is false for an ownerless one.
The automation route's error handler looked every coded refusal up in the skill door's status map, which also moved the package lane's own STORAGE_NOT_FOUND from 400 to 404 while leaving other refusals at 400. Only the team-audience refusals (TEAM_NOT_IN_ORG, TEAM_ACCESS_DENIED) need the skill door's statuses, so both upload lanes agree on them; every other refusal of the lane keeps its 400.
The refusal a team-audience upload answers says the caller cannot share with that team; it does not name the team, whose id only travels in the error data neither upload dialog reads. A tester following the box would have logged a false failure.
A skill's creator was stored as a user id in its frontmatter and never shown, and only deletions reached the audit log, so nobody could tell who published a skill to the organization or changed it since. Every skill view now carries `origin` (builtin, release, member) and, via one organization-scoped member read per listing, `ownerName`; a departed or foreign id stays nameless and reads as "Former member". The app save, the ZIP upload, REST PUT and an automation package's carried skills record skill.created, skill.updated (with changed fields) and skill.sharing_changed (audience before and after) inside the writer lock, each with the resulting etag. "Last edited by" is the newest such row while its etag is still the stored one, so an out-of-band edit shows no editor rather than a wrong one; no sidecar file, no migration. The library gains a Created by column (searchable), the skill dialog Created by / Last edited by rows, and the agent skill picker a creator caption under each skill. REST contract 3.4.0 adds the fields.
The skill library now names each skill's creator and last editor and records skill writes in the audit log, so the EN/DE/FR skill pages say how Created by and Last edited by read (Built-in, Configuration release, Former member, left out after an edit outside Tale), where the audit entries appear, and list the `owner` frontmatter key. The agent skills page mentions the creator caption in the picker, and the API reference describes `origin`, `ownerName`, `updatedBy` and `updatedByName`.
SKILL-F16 to SKILL-F19 judge what a headless run cannot: the Created by column and dialog rows in three locales with a departed member and a release skill, Last edited by across an out-of-band edit, the creator caption in both agent skill pickers, and the audit rows each write door leaves under Governance > Logs. SKILL-F1 lists the new column and the creator search; the coverage map names the specs that own the rest. SKILL-F15 is left to the in-flight agent-skill-descriptions box.
The write-failure test kept a bare reference to the host's withSkillWriterLocks method, which the type-aware unbound-method rule refuses at error level and turns the workspace lint red. Binding it to the host keeps the wrapper's behaviour and satisfies the rule.
The first audit row takes the organization's audit-chain lock until the writer-lock transaction commits. Recording each carried skill right after its bundle held that lock while the remaining bundles were written to disk, stalling every other audited write in the organization behind the package install. The rows are now collected and written once the last bundle is on disk, still inside the same transaction; a failed install still keeps the rows of the skills written before it.
The builtin | release | member union was spelled out separately in the backend skill views, the attribution hook, the skills table and the REST spec. It now lives once in @tale/shared/schemas/skills as SKILL_ORIGINS and SkillOrigin, next to SKILL_VISIBILITIES, and every one of those imports it. The app's materialized wire contracts keep their inline literals, as they do for visibility.
Saving an agent checks its named skills against the project's capability listing, which now resolved every skill's creator and last editor: a DISTINCT ON over the audit log and a member join the check never reads. The listing takes an attribution option; the equipment check opts out, and the pickers keep the attributed default.
A skill reads as a configuration release when its frontmatter carries the release compiler's marker, and that marker is plain frontmatter any member's zip upload can include. Only the skill dialog named the member whose upload installed it; the library's Created by column and the agent skill pickers showed the bare label and hid the uploader. Every surface now reads Configuration release with the installing member's name, so a member cannot pass their own skill off as a managed release.
The Created by column and the agent skill picker now name the installing member beside Configuration release, not only the skill dialog.
SKILL-F16 and SKILL-F18 now expect Configuration release with the installing member in the table and the picker, and SKILL-F16 adds a member's zip that carries the release marker, which must still name that member.
GET /api/v1/skills/{slug} tags the answer with the SKILL.md hash, while
the body also carries canEdit and the creator and last-editor names.
Those can change under an unchanged tag, so a 304 does not revalidate
them. The operation now says so, instead of implying the tag covers the
whole answer.
This was referenced Sep 29, 2026
…r-audience # Conflicts: # services/platform/tests/manual/readme.md
… into feat/skill-created-by # Conflicts: # services/platform/tests/manual/readme.md
… into feat/skill-created-by # Conflicts: # services/platform/tests/manual/suites/skills.md
yannickmonney
changed the base branch from
fix/skill-upload-owner-audience
to
main
September 29, 2026 03:02
yannickmonney
changed the base branch from
main
to
fix/skill-upload-owner-audience
September 29, 2026 03:02
The base PR landed as a squash commit, so this merge takes main and keeps only this branch's own changes on top of it.
Only attribution.ts calls memberDisplayNames, so knip flags the export.
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #3776; review only the top commits, from
feat(platform): show who created and last edited a skillonwards (the feature, its docs and manual boxes, then the review follow-ups).Customer feedback asked to at least see who created a skill. The creator was already stored as a user id in the
SKILL.mdfrontmatter, but no screen showed it, REST returned only the id, and the audit log recorded skill deletions and nothing else. This PR shows who created and who last edited each skill, and records every skill write in the audit log.origin:releasewhen the frontmatter has the release compiler'smetadata.tale-releasemarker,builtinwhen no owner is recorded,memberotherwise. The app skills routes, the REST skills routes and the agent capability listings addownerNamewith one member lookup per listing, scoped to the organization, following howcreatedByNameworks for documents. A departed member, or an id that belongs to nobody in the organization, gets no name. The UI then shows "Former member", and a name from another organization can't leak through a declared id.PUT /api/v1/skills/{slug}and the skills carried by an automation package all recordskill.created,skill.updated(with changed fields) andskill.sharing_changed(visibility and teams before and after). Each row carries the resultingetagand the door it came through. The rows are written inside the transaction that holds the skill's writer lock. A write that changes nothing records nothing. The automation-package lane writes its audit rows only after the last carried bundle is on disk, still inside that transaction, so it does not hold the organization's audit-chain lock while it writes files. If a package fails partway, the error is raised only after the lock's transaction commits, so the skills already installed keep their audit rows. The rows appear under Settings > Governance > Logs in the Skill category, with labels in en/de/fr.skill.created/skill.updated/skill.deletedrow is askill.updatedwhoseetagmatches the storedSKILL.md. If nobody has edited the skill since it was created, or the file changed outside Tale, the row is left out rather than showing the wrong person. There is no sidecar file, no migration, andSKILL.mdbytes are never touched, so release byte verification and the identical-save no-op still work.useSkillAttribution, and thebuiltin | release | memberset lives once in@tale/shared/schemas/skillsnext to the visibility set.SkillSummaryandSkillgain the requiredoriginand the optionalownerName,updatedByandupdatedByName. The spec,openapi.json, the fingerprint and the version notes are updated. The number may need to change at merge. TheGET /api/v1/skills/{slug}description now says theETagcovers theSKILL.mdcontent only, so a 304 does not revalidatecanEditor the attribution fields. MCP is unchanged because it has no skill tools.workspace/skills.mdgets a section on seeing who created and changed a skill and addsownerto the file reference.agents/skills.mdmentions the picker caption, anddevelop/api-reference.mddescribes the new fields. The new manual boxes are SKILL-F16 to SKILL-F19. I skipped SKILL-F15 because the open agent-skill-descriptions branch already uses it. SKILL-F1 now lists the column, SKILL-F16 and SKILL-F18 expect the installer beside every release label, and the coverage map has a new row.Checklist
bun run checkpasses: N/A as one run. I didn't run it locally and am leaving it to CI. What I ran instead is listed under Test plan.bun run lint:sastpasses: N/A as a full scan. The commit hook ran Opengrep on the staged files of each commit.messages/{en,de,fr}.yml:skills.columns.createdBy,skills.attribution.*, andsettings.logs.audit.actionLabels.skill.{created,updated,sharing_changed}. No de-CH override was needed because none of the strings contain ß.docs/{en,de,fr}/: workspace/skills, agents/skills and develop/api-reference.README.md/README.de.md/README.fr.md: N/A, nothing at README level changed.Test plan
bun run --filter @tale/platform typecheckandbun run --filter @tale/shared typecheckare clean. The workspace-levelbunx oxlint --type-awareexits 0 forservices/platformandpackages/shared. An earlier revision of this PR claimed a clean lint whileupload_impl.skills.test.tsbroketypescript(unbound-method); that is fixed and re-checked.bun run test) coverbackend/domains/skills,backend/core/skills,backend/core/automations,backend/domains/automations,backend/domains/chat,backend/rest,scripts/openapiandlib/i18n(locale parity). All green: the widest run was 104 files and 1951 tests, and the rerun after the review follow-ups coveredbackend/core/skills,backend/domains/skills,backend/domains/automations,backend/domains/chat,backend/core/automations,backend/domains/projects/agent-equipment.test.ts,backend/rest/v1-core.contract.test.tsandscripts/openapi(91 files, 1353 tests). New specs:audit.test.ts: created, updated, sharing changed, reordered teams, files only, and a no-op.attribution.test.ts: member, former member, empty name falls back to email, last editor while the etag holds, no editor after drift or right after creation, stale attribution dropped, and one directory read scoped to the organization.routes.attribution.test.ts: the app door enriches its responses, audits inside the lock, and passes the actor to uploads.upload.test.ts: ZIP created or replaced, and an unreadable stored bundle still uploads.upload_impl.skills.test.ts: the package lane records created, unchanged and replaced skills, and keeps the rows of skills installed before a later failure. That test fails on the old code, because the error used to be raised inside the transaction and rolled the rows back. A further test checks that every bundle is written before the first audit row; it fails when the rows are recorded inside the loop.upload.pool.test.ts: audit rows go through the connection that holds the lock.v1-core.contract.test.ts(REST over a real temporary config tree): the audit rows andownerName/updatedByon create and edit, nothing recorded for an identical save, and no editor after a hand edit on disk.file_actions.test.ts: origin, the revisions before and after a save, and thatdescribeBundleWritecomputes the same etag the listing reads.spec.test.ts: the closed schema accepts the new fields and requiresorigin.agent-equipment.test.ts: the equipment check reads the listing without attribution.bun run test:ui) coverskills-settings.test.tsx(column values, a release with its installer, and searching by creator or installer),skill-detail-pane.test.tsx(the rows, a former member, built-in, a release with its installer),skills-menu.test.tsx(the captions, a release caption that names its installer, and no caption on connectors), and the existing project-agent, automation agent-node, blank-automation, audit-log and backend-adapter suites.bun run test:browserforapp/features/skillsis green.bun run lint:manualandtests/manual/scripts/check-guide.tspass onsuites/skills.md. Theservices/docstests pass (171).Not verified:
DISTINCT ONoveraudit_logs_org_resource) runs only against a fake SQL double. Nobackend:integrationlane covers it yet.skill-library-detail.webp(EN/DE/FRworkspace/skills.md) now lacks the Created by row the dialog shows. Its alt text still matches the image as it is. Re-capturing it and updating the alt text is a follow-up, since I didn't run the screenshot pipeline.