Repository navigation
Conversation
… after you confirm Builds the issue from the description plus plugin, altimate-code, Claude Code, OS, dbt and settings facts (and, with --with-error, the last plugin error, redacted), shows the exact title and body, and creates it with gh issue create or a prefilled new-issue link after --confirm. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
…n /feedback shadows a plugin command of that name Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ct the description before cutting it, and drop a draft that is discarded while it is built Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…iption instead of cutting it, clear the shown draft while a replacement is built, and redact JSON-escaped home paths Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ng quote, and clear the shown draft before a refused replacement Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lues, ~/ paths and parenthesised folder names Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd blank lines included Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es whole Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t keys whole Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…and a last unquoted one, whole Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, and treat doubled quotes in a quoted connection-string password as part of it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…en and cut them in one pass, so no rule can hide another's match Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…times Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… of times Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… number of times Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mand as it is registered Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cdbf851 to
80d8231
Compare
…oted values by depth, pin gh to github.com, and report settings as in effect - rules that may fail after reading far start only where their run starts or read a bounded length - YAML block headers with the indentation indicator first, values ending at a sibling key, tab-indented values, and quoted values continued on deeper lines - a quoted password ends at its closing quote; an open quote is cut to the end of its line only - a URL password is cut whatever precedes the scheme - gh label list and issue create name github.com, so GH_HOST cannot redirect them - the settings line reads each setting as the feature it switches reads it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a token rule only where its run starts, and cut bare Databricks and Google keys - a plain value's indented continuation lines, and an empty value's indented lines, are cut with it - the JWT rule starts only where its run starts, so a long run is not rescanned from every position - Databricks personal access tokens and Google API keys are cut without a key name - the altimate binary names come from altimate-cli.ts - tests for Windows link-only, a session ending while a draft is built, simultaneous confirmations, and the flag alone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mand-line flags, dbt Cloud tokens and Slack webhooks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…very keyed value one way - a key is a credential when it ends in a credential word or holds one as a part of its name (SECRET_KEY, DBT_ENV_SECRET_PG, encryption_key) - `key=value`, `key: value`, YAML flow mappings (the value may start on the next line) and command-line flags share one value reader: quoted, shell-escaped or one word - the next key is looked for after a value that was cut, so a long run of keys is read once - connection-string values are read at most 256 characters from each key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, and bound a quoted home path's read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
review-loop: APPROVED at 8bb31d4 (reviewers: Claude CLI, Codex CLI) Non-blocking follow-ups noted by the reviewers:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review SummaryStatus: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (11 files)
Fix these issues in Kilo Cloud Reviewed at commit Reviewed by deepseek-v4.1-flash-1017 · Input: 278.7K · Output: 60.5K · Cached: 3.5M |
sahrizvi
left a comment
There was a problem hiding this comment.
Consensus review (panel: Claude and Codex): request changes on one item, M1. Everything else is minor or nit.
Reviewed head 883920d (8bb31d4 merged with current main).
Verified as claimed:
- Sent text: a live
claude -psession with a fakegh/openon PATH sent stdin and--titlebyte-identical to the shown draft, with$(whoami),--label x,#,&,+, emoji and newlines in the text. - Host pin: every
ghcall is host-pinned. With the realgh,GH_HOST=<bogus>did not redirect--repo github.com/…, and it did redirect the unprefixed form, so the pin is needed. - One issue: two confirmations create one issue, and
--cancel, replace and session end drop the draft. - Attached facts: these carry no free text, and
--with-errorkeeps only listed kinds. Tested with a SQL compile error naming a relation, ENOENT with a home path, and non-Error values. - Redaction: 184 realistic inputs, covering profiles.yml for snowflake, bigquery, databricks, postgres, redshift, duckdb, trino and sqlserver,
.env,dbt debug, tracebacks, URLs,--vars, tokens and PEM. Every common shape was cut. - Speed: the worst 100K shape took 20 ms.
- Tests: feedback.test.tsx is 67/67. The full suite is 1330/1; the one failure is the known
runs.test.tsxflake, which passes alone.tests/*.shall pass. Mutations of the keyed rule, the YAML spans, the URL rule, the home spans and both host pins are each caught.
Blocking: M1 (major). Drafting starts altimate --version before --confirm. It is local and harmless, and the PR's own claim ("neither gh nor a browser") holds, but this review's bar is "no process before confirm". Reusing the version the plugin reads at session start clears it.
Remaining minors, none blocking:
- m1, a real
ghtimeout opens the link: edge, needs a 60 s hang. - m2, multi-line
.envand$'…'quoting: exotic. - m3, another account's home path: edge.
- m4, an unspaced quoted-key flow value: exotic.
- m5, an unencoded
@in a URL password: edge. - m6, a braced PWD over 256 characters: exotic.
- m7, m10, m11, over-redaction: no leak.
- m8, a stale error kind after
/clear: edge, kind only. - m9, the draft does not say "public" or the account: wording.
- m12, exotic token shapes: exotic.
- m13, a doctor version suffix or adapter name: edge.
- m14, WSL
/mnt/c/Users: WSL.
The nits and conflict notes are in a separate comment.
| async function altimateFacts($: EngineInterface): Promise<Facts['altimate']> { | ||
| for (const name of CLI_NAMES) { | ||
| try { | ||
| const answer = await $.process.run([name, '--version'], { timeoutMs: 10_000 }) |
There was a problem hiding this comment.
major (M1): a process starts before --confirm. Drafting runs altimate --version (then altimate-code --version) to fill the version line. It is local and read-only, and it is not gh or a browser, so the PR's own claim holds. But this review's bar is "nothing is started before you confirm". The plugin already runs the same probe at session start (altimateCodeNotice, altimate-cli.ts:83). Caching that answer and reading it here would clear this. Seen live: a draft-only run logged altimate --version and nothing else.
| return linkAnswer($, draft, `gh could not create the issue (${(await reasonOf($, made.stderr || made.stdout)) || `exit ${made.exitCode}`}).`, dry) | ||
| } catch (error) { | ||
| // A call that timed out may have created the issue: it is not retried. | ||
| if (/time(d)? ?out/i.test(String(error))) return 'gh took too long to answer; the issue may have been created. Check the repository\'s issues before trying again.' |
There was a problem hiding this comment.
minor (m1): the real runtime's timeout error does not match /time(d)? ?out/i. Claude Code 2.1.329 throws HooksError: altimate-code: $.process.run(gh) aborted: still running after 60000ms. Live, with a fake gh sleeping 75 s on issue create, the answer was "gh could not create the issue (…)" and the prefilled link was opened. The issue may already exist, so submitting the link files a duplicate. The test fakes process timed out after 60000ms, which is why it passes. Matching still running after (or any thrown error once the create has started) would fix it. Not blocking: it needs gh to hang 60 s, and a duplicate needs the user to press Submit.
| // A value after a credential key: a quoted value to its own closing quote (a backslash escape or a doubled quote is inside it; so is a | ||
| // JSON-escaped quote, to the escaped quote of the same depth; a quote left open runs to the end of its line, never past it) or the rest of | ||
| // the word, a shell-escaped space (`correct\ horse`) included, up to a `;` that starts the next `key=` field. Read from where the key ends. | ||
| const KEY_VALUE = /(?:"(?:[^"\\\n]|\\.|"")*(?:"|(?=\n)|$)|'(?:[^'\\\n]|\\.|'')*(?:'|(?=\n)|$)|(?<!\\)(\\+)"(?:(?!(?<!\\)\1")[^\n])*(?<!\\)\1"|(?:\\[^\n]|[^\s;\\]|;(?!\w+=))+)/y |
There was a problem hiding this comment.
minor (m2), exotic shape: a multi-line double-quoted .env value, PASSWORD="first\nsecond-secret", becomes PASSWORD=‹redacted›\nsecond-secret". ANSI-C quoting, DBT_PASSWORD=$'alpha beta' dbt debug, becomes DBT_PASSWORD=‹redacted› beta' dbt debug. Single-line .env forms (quoted, export, comments, spaces) all redact.
| function homeSpans(text: string, homes: readonly string[]): Span[] { | ||
| const spans: Span[] = [] | ||
| // `~` stands for the home folder whoever the user is, so it counts only before a separator. | ||
| const forms = [...homeForms(homes).map(form => escapeRegex(form)), '(?<![\\w.~/\\\\-])~(?=[\\\\/])'] |
There was a problem hiding this comment.
minor (m3), edge input: only HOME/USERPROFILE and ~/ count as home. With HOME=/Users/alice, the paths /Users/bob/work/acme/models/payroll.sql, /home/bob/private/x.sql and C:\Users\Bob\x.sql (on macOS) survive whole. The user's own home is always cut. A generic /Users/<name>/, /home/<name>/ and <drive>:\Users\<name>\ rule would also cover logs pasted from another account.
| const escapeRegex = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') | ||
|
|
||
| /** The home folder forms to look for, from the values of HOME and USERPROFILE. */ | ||
| function homeForms(homes: readonly string[]): string[] { |
There was a problem hiding this comment.
minor (m14), WSL: on WSL, HOME is /home/<name>, so the Windows profile seen as /mnt/c/Users/<name>/… is not cut.
| * so a secret that straddles the cut is gone whole. The person's other words are kept. | ||
| */ | ||
| export function cleanDescription(text: string, homes: readonly string[]): string { | ||
| const clean = redactAll(plain(text).trim(), homes) |
There was a problem hiding this comment.
minor (m11), over-redaction: the .trim() before redaction strips the first line's indentation. A pasted fragment password: x\n role: R then has its key at column 0, so role: R is read as a continuation and cut. Redacting the untrimmed text and trimming afterwards avoids it.
| const SIBLING_KEY = /^[ \t]*(?:-[ \t]+)?["']?[^\s:"']+["']?[ \t]*:(?:[ \t]|$)/ | ||
|
|
||
| /** Each pattern's group 1, when it has one, is text that stays (a key, a scheme); the rest of the match is cut. */ | ||
| const SECRET_PATTERNS: RegExp[] = [ |
There was a problem hiding this comment.
minor (m12), exotic shapes: these survive: Stripe sk_live_… (the sk- rule wants a hyphen), GitLab glpat-…, a bare 40-character AWS secret holding /, Azure SAS sig=…, mysql -pPASS, <password>x</password>, pw=x, and "my password is X". This is fine as best effort. The first three are cheap to add.
| return [ | ||
| `Draft issue for ${REPO}. Nothing has been sent.`, | ||
| '', | ||
| `Title: ${draft.title}`, |
There was a problem hiding this comment.
minor (m9), wording: the preview does not say the issue will be public, or which GitHub account files it. README and PRIVACY do say both. gh auth status --hostname github.com already prints the account ("Logged in to github.com account "). Showing that at confirm, or a line such as "Public issue on github.com/AltimateAI/altimate-claude-plugin, filed as you" in the draft, would close it.
|
|
||
| function failed($: EngineInterface, id: string, part: string, error: unknown) { | ||
| try { | ||
| noteProblem(`${id} ${part} failed`, String(error)) |
There was a problem hiding this comment.
minor (m8), timing edge: an attempt that rejects after /clear still calls noteProblem, after feedbackSessionEnd has run forgetProblem. A later --with-error then attaches the previous conversation's error kind. It is the kind only, never the message. A generation check, like the draft's epoch, would drop it.
| /** The versions the dbt doctor found, when it has run. */ | ||
| export type DoctorFacts = { dbtCore?: string; adapter?: string; python?: string } | null | ||
|
|
||
| const VERSION = /^\d+(?:\.\d+){0,3}(?:[-+][0-9A-Za-z.+-]{1,40})?$/ |
There was a problem hiding this comment.
minor (m13), edge: asVersion allows a build suffix of up to 40 [0-9A-Za-z.+-] characters (1.8.2-acmecorp.build passes), and the adapter name is any ^[a-z][a-z0-9_]{1,30}. Free text can only come from a custom-built dbt or adapter. Limiting the suffix to PEP 440 / semver pre-release forms (a1, rc2, b3, dev4, post1) would close it.
|
Consensus review (Claude and Codex): nits and findings not tied to a diff line. The formal review with inline comments is above. Nits
Merge-tree against the open PRs
Test gap: the timeout test fakes |
sahrizvi
left a comment
There was a problem hiding this comment.
Consensus review (Claude lead + Codex): approve. This supersedes the CHANGES_REQUESTED on 883920da49.
The one major is withdrawn. It applied the review's rule "any process started before --confirm blocks" literally to the draft step running altimate --version (then altimate-code --version) so the draft can show the CLI version. That is a local read-only call with no network, not gh or a browser, and the user sees the result before anything is sent. The rule was meant for anything that sends; this is informational, not a block. Reusing the version read at session start would still be a tidy follow-up.
What the review confirmed: nothing reaches gh or a browser before --confirm; the sent title and body match the shown draft byte for byte; common profiles.yml, .env and connection-URL credentials and the user's own home paths are cut; no error message or project free text reaches the attached facts; GH_HOST cannot redirect the calls; the slowest 100,000-character shape redacts well under the limit; no real issue was created during review.
The 14 minors and the nits stay as posted in the inline comments and the combined comment and do not block. The one worth doing before release: the timeout check /time(d)? ?out/i never matches the runtime's actual abort error, so a gh issue create that hangs past 60 s falls through to opening the prefilled link, which can file the issue twice. The preview could also name the GitHub account gh will file under.
What
/altimate-feedback <what happened>drafts a GitHub issue for this repository from the user's words plus a few facts the plugin already knows. It shows the exact title and body, and creates the issue only after/altimate-feedback --confirm.It is a mod command, like
/deferor/dbt-show. It is not named/altimate-code:feedbackor/feedback: Claude Code's own/feedbacktakes that name over a plugin's, and a mod cannot register a namespaced name. Both were tried live.Behaviour
/altimate-feedback <text>shows the draft (title and body). Nothing is sent, and neitherghnor the browser is started. Run without text, it says how to start./altimate-feedback --confirmcreates exactly what was shown:ghinstalled and signed in (gh auth status --hostname github.com): runsgh issue create --repo github.com/AltimateAI/altimate-claude-plugin --title … --body-file -with the body on stdin, and prints the created URL. It adds--label feedbackonly when the repository has that label. Everyghcall names github.com, so aGH_HOSTset for another GitHub cannot redirect it.ghnot installed, not signed in, or failing): prints a prefilledissues/new?title=…&body=…link and opens it withopenon macOS orxdg-openon Linux. On Windows and WSL the link is only printed. The link is URL-encoded and kept under 7000 characters; a longer body is cut on a character boundary, with a note. The plugin never signs in.ghcall that times out is not retried, since the issue may already exist.--canceldiscards the draft. A new description replaces it. The draft lives in memory only and ends with the session. A description that only contains the word--confirmis treated as a description. Two confirmations, even at the same moment, create one issue.What is attached, and what is removed
Attached:
'true'or an unset default is reported as it takes effect--with-error(opt-in) adds the kind of the last plugin error. Only what a fixed list recognises is kept, and it is kept at the moment the error happens:Database Error)The message itself is never stored.
The description keeps the user's own words. Before it is cut to length, the whole text is redacted, best effort. The user sees the exact result before anything is sent. What is cut:
sk-, AWS keys, Slack, JWT, Databricks, Google API, dbt Cloud, Slack webhooks, private keysAuthorizationandBearervaluesuser:password@in URLsDBT_PASSWORD,client_secret) or has one as a whole part of its name (SECRET_KEY,DBT_ENV_SECRET_PG)key=value,key: value, JSON (escaped at any depth), Ruby=>, YAML block, plain, multi-line and quoted values, YAML flow mappings, shell-escaped values, and command-line flags (--password "…")~/…Speed: every rule is linear, or reads a bounded length from each start, so a description at the 100,000-character limit is redacted in well under a second.
ALTIMATE_FEEDBACK_DRY_RUN=1makes--confirmcheckgh auth status, print theghcommand (or the link) and stop.Files
hooks/feedback.ts: payload builder, redaction, link builder, send, command.hooks/last-problem.ts: the in-memory last error and the doctor-version parser. It is a separate file so the dbt helpers can record into it without an import cycle.hooks/features/index.ts,hooks/dbt-mods.tsx,hooks/usage.ts,hooks/altimate-cli.ts: record the last error, read the doctor's versions, exportpluginVersionand the altimate binary names.hooks/dbt-mods-core.ts: a single-quoted YAML form (doubled apostrophes) of profile values, for redaction.[Unreleased](version not bumped), PRIVACY.md section.There is no "Report" button on the failure band: a button can submit a prompt but cannot pre-fill the composer.
Tests
claude plugin test plugins/altimate-code: 1330 pass, 1 fail. The failure is the known timing flake "a dbt call that starts while another call reads its artifact" infeatures/runs.test.tsx, which this PR does not touch; under load "a line with a great many dbt calls is not read call by call" (features/cost.test.tsx) can flake too.hooks/feedback.test.tsxcovers:ghpresent, label present or missing,ghmissing (macOS, Linux, Windows), not signed in, create failing, create timing out, host-pinnedghcallsghor browser call before--confirm--confirmwith no draft, after--cancel, or after the session ends mid-draftclaude plugin validate --strict .: passed.bash tests/*.sh: all pass.Live check
Ran in real interactive Claude Code 2.1.329 (
claude --plugin-dir plugins/altimate-code) in a scratch copy of a dbt project, withALTIMATE_FEEDBACK_DRY_RUN=1. No issue was created on the real repository.password=…in the description were redacted.--confirmprinted thegh issue createcommand and stopped.ghoff PATH:--confirmprinted the encoded prefilled link and nothing else.Conflicts with open PR #44 (
fix/hands-on-findings)git merge-treeof this branch against its current head: one content conflict inplugins/altimate-code/hooks/dbt-mods.tsx, in the import block: both PRs add an import on the same line. Keeping both imports resolves it. CHANGELOG, README anddbt-mods-core.tsmerge cleanly. Whichever PR merges second needs a small manual resolution.🤖 Generated with Claude Code