Repository navigation
Agent flavour: GitHub features for agent prose without forge references - #12
Merged
Merged
Conversation
Flavor::Agent draws everything Flavor::Github does (footnotes, alerts, the allowlisted raw-HTML subset, task source offsets, emoji shortcodes, mermaid diagram placeholders, GFM options) except forge references: @user, @org/team, #123, owner/repo#123, commit SHAs and owner/repo@sha stay plain text. Both flavours share the github pipeline, which now takes the flavour and asks Flavor::forge_references() whether prose links them. Exposed as from_name("agent") / from_code(2), MARKIT_FLAVOR_AGENT, MarkitFlavor.agent (Swift), MarkitFlavor.AGENT (Kotlin) and the web 'agent' flavour, with docs on choosing a flavour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGundEKcKxSP6F8iQUnRZk
arpan404
pushed a commit
to arpan404/ace
that referenced
this pull request
Oct 29, 2026
markit 0dc267e (arpan404/markit#12) adds Flavor::Agent: GitHub's footnotes, alerts, safe HTML subset, task lists and diagrams, with @mentions, #refs and commit hashes left as text. The look test now runs in that flavour and passes; its style lookups are inlined for the lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGundEKcKxSP6F8iQUnRZk
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
Adds a third rendering flavour,
Flavor::Agent, for coding agents' chat answers. It draws everythingFlavor::Githubdraws: footnotes,> [!NOTE]alerts, the allowlisted raw-HTML subset (<details>,<summary>,<kbd>,<sub>,<sup>,<picture>,<img>,<video>, with media never loading directly), task source offsets, emoji shortcodes, mermaid diagram placeholders and the GFM options. The one difference is that it leaves forge references alone:@user,@org/team,#123,owner/repo#123, commit SHAs andowner/repo@shastay plain text. In agent prose, "step #1" or a hash in a log doesn't point at any repository.Design
githubmodule now takes the flavour instead of hard-codingFlavor::Github. Two small capabilities onFlavorcontrol the behaviour:github_markdown()selects the GitHub pipeline, whichGithubandAgentboth use.forge_references()is true only forGithub.Front(the reader both HTML and native output share) turnsforge_references()intoTextMode::Prose { references }. Autolinking then passes that flag to the existingsegments(text, references), so footnote definitions and streamed blocks follow the flavour as well.render_block/block_documentnow take a builtFrontrather than its parts. This keeps them under clippy's argument limit.API per platform
Flavor::Agent,Flavor::from_name("agent"),Flavor::from_code(2). Works withrender_html_with,parse_with,render_document_json_with,render_document_binary_withandStreamRenderer::with_flavor.renderHtmlFlavor(src, 'agent'),renderDocumentFlavor,MarkdownStream.webFlavor('agent'), andMarkitRenderer{ flavor: 'agent' }(the worker and inline engine already pass the name through).MarkitFlavor = 'default' | 'github' | 'agent'inindex.d.ts. The task, diagram, media and footnote hooks ingithub.jswork unchanged, because they key off attributes, not flavour.MARKIT_FLAVOR_AGENT 2uinmarkit.h.markit_render_flavor,markit_render_binary_flavorandmarkit_stream_new_flavoraccept 2.MarkitFlavor.agent. It works everywhere a flavour is accepted (Markit.parse,MarkitBinaryPlan.parse,MarkitStream,MarkitInlineView,MarkitInline,MarkitView/MarkitText). Nothing switches on flavour exhaustively.MarkitFlavor.AGENT(code 2) through the existing JNInativeRenderFlavor/nativeCreateStreamFlavor.docs/integration.mdnow has a section called "GitHub and agent flavours" that explains when to use each flavour, anddocs/binary-transport.mdis updated.Tests
crates/markit/tests/agent_flavor.rs:<details>,<kbd>, a mermaid placeholder, task offsets and emoji is identical to GitHub's@octocat,@github/docs,#12,owner/repo#3, a 40-hex SHA,owner/repo@shaand a short SHA stay plain text under Agent, including inside footnotes, but become references under GitHubfrom_name/from_codeselect the flavourgithub_stream.rs: an agent-flavour stream fed one character at a time matches a one-shot render (HTML, native text and spans) for every fixture.flavor: 'agent'draws a<details>block and a footnote and leaves#12/@octocatas text. Node inline engine: same check.BridgeTests:.agentparses a footnote but not a mention, in one-shot and stream.NativeBridgeTest: same check.All 5 CI jobs pass (core-and-web, ios, ios (grammars), android, android (grammars)).
Generated by Claude Code