Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import { partialMention } from "./mention.ts"; | |
| 5 | ||
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 6 | test("an @ that could become @g1t is offered", () => { |
| Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API | 7 | assert.equal(partialMention("@", 1), 0); |
| 8 | assert.equal(partialMention("thanks @g1", 10), 7); | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 9 | assert.equal(partialMention("(@G1", 4), 1); |
| 10 | assert.equal(partialMention("line\n@g", 7), 5); | |
| Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API | 11 | }); |
| 12 | ||
| 13 | test("anything else is not", () => { | |
| 14 | // Already complete. | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 15 | assert.equal(partialMention("@g1t", 4), null); |
| 16 | assert.equal(partialMention("@G1T", 4), null); | |
| 17 | // Longer names that start with it are other names. | |
| Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API | 18 | assert.equal(partialMention("@g1t-agent", 10), null); |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 19 | assert.equal(partialMention("@g1t-a", 6), null); |
| 20 | assert.equal(partialMention("@g1t/g1t", 8), null); | |
| 21 | assert.equal(partialMention("@g1tx", 5), null); | |
| Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API | 22 | // Another name. |
| 23 | assert.equal(partialMention("@ana", 4), null); | |
| 24 | // An email address. | |
| 25 | assert.equal(partialMention("me@g1", 5), null); | |
| 26 | // The caret is not at the end of it. | |
| 27 | assert.equal(partialMention("@g1 later", 9), null); | |
| 28 | }); |