Skip to content

feat(platform): show who created and last edited a skill - #3786

Merged
yannickmonney merged 26 commits into
mainfrom
feat/skill-created-by
Sep 29, 2026
Merged

yannickmonney merged 26 commits into
mainfrom
feat/skill-created-by

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #3776; review only the top commits, from feat(platform): show who created and last edited a skill onwards (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.md frontmatter, 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.

  • Created by. Every skill view now carries origin: release when the frontmatter has the release compiler's metadata.tale-release marker, builtin when no owner is recorded, member otherwise. The app skills routes, the REST skills routes and the agent capability listings add ownerName with one member lookup per listing, scoped to the organization, following how createdByName works 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.
  • Audit. The app save, the app ZIP upload, PUT /api/v1/skills/{slug} and the skills carried by an automation package all record skill.created, skill.updated (with changed fields) and skill.sharing_changed (visibility and teams before and after). Each row carries the resulting etag and 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.
  • Last edited by. This is worked out on the server. A skill has a last editor only when its newest skill.created/skill.updated/skill.deleted row is a skill.updated whose etag matches the stored SKILL.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, and SKILL.md bytes are never touched, so release byte verification and the identical-save no-op still work.
  • UI. Settings > Skills gets a Created by column. The column is searchable, and the five column sizes still add up to the settings column width. The skill dialog gets Created by and Last edited by rows. Both agent skill pickers (project agent and automation agent node) show a caption under each skill: "By Ada", "By a former member", "Built-in" or "Configuration release · Ada". A configuration release always shows the member whose upload installed it, in the column, the dialog and the picker. The release marker is plain frontmatter that any member can put in a zip, so a bare "Configuration release" would let a member hide their own name. All labels go through one hook, useSkillAttribution, and the builtin | release | member set lives once in @tale/shared/schemas/skills next to the visibility set.
  • REST contract 3.4.0 (minor, additive). SkillSummary and Skill gain the required origin and the optional ownerName, updatedBy and updatedByName. The spec, openapi.json, the fingerprint and the version notes are updated. The number may need to change at merge. The GET /api/v1/skills/{slug} description now says the ETag covers the SKILL.md content only, so a 304 does not revalidate canEdit or the attribution fields. MCP is unchanged because it has no skill tools.
  • Agent save cost. Saving an agent checks its skills against the project's capability listing. That check now skips the attribution reads (the audit query and the member join), which only the pickers need.
  • Docs and manual tests. EN/DE/FR workspace/skills.md gets a section on seeing who created and changed a skill and adds owner to the file reference. agents/skills.md mentions the picker caption, and develop/api-reference.md describes 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 check passes: 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:sast passes: N/A as a full scan. The commit hook ran Opengrep on the staged files of each commit.
  • Translations updated in messages/{en,de,fr}.yml: skills.columns.createdBy, skills.attribution.*, and settings.logs.audit.actionLabels.skill.{created,updated,sharing_changed}. No de-CH override was needed because none of the strings contain ß.
  • Docs updated in 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 typecheck and bun run --filter @tale/shared typecheck are clean. The workspace-level bunx oxlint --type-aware exits 0 for services/platform and packages/shared. An earlier revision of this PR claimed a clean lint while upload_impl.skills.test.ts broke typescript(unbound-method); that is fixed and re-checked.
  • Server tests (bun run test) cover backend/domains/skills, backend/core/skills, backend/core/automations, backend/domains/automations, backend/domains/chat, backend/rest, scripts/openapi and lib/i18n (locale parity). All green: the widest run was 104 files and 1951 tests, and the rerun after the review follow-ups covered backend/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.ts and scripts/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 and ownerName/updatedBy on 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 that describeBundleWrite computes the same etag the listing reads.
    • spec.test.ts: the closed schema accepts the new fields and requires origin.
    • agent-equipment.test.ts: the equipment check reads the listing without attribution.
  • UI tests (bun run test:ui) cover skills-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:browser for app/features/skills is green.
  • bun run lint:manual and tests/manual/scripts/check-guide.ts pass on suites/skills.md. The services/docs tests pass (171).

Not verified:

  • I didn't bring up a stack or open a browser session, so the real audit hash chain, the Governance > Logs rendering of the new rows, the column layout in German and French, and a real departed member are unobserved. SKILL-F16 to SKILL-F19 cover these.
  • The real-Postgres audit read (DISTINCT ON over audit_logs_org_resource) runs only against a fake SQL double. No backend:integration lane covers it yet.
  • The documented screenshot skill-library-detail.webp (EN/DE/FR workspace/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.
  • The release label still depends on frontmatter. Only showing the installer makes a spoofed release visible; it does not stop it. Trusting the marker only from an admin or the release deploy path would be a product change, because a release installs through the same automation-package upload as any member. That is left as a follow-up.
  • If the open column-width work (fix(platform): size every table's columns to their content #3502) lands first, it may want to re-check the new sizes: name 180, description 200, created by 140, visibility 130, labels 116.

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.
…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
yannickmonney changed the base branch from fix/skill-upload-owner-audience to main September 29, 2026 03:02
@yannickmonney
yannickmonney changed the base branch from main to fix/skill-upload-owner-audience September 29, 2026 03:02
Base automatically changed from fix/skill-upload-owner-audience to main September 29, 2026 03:32
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant