How many total animals were observed at Oak Bluff?
-The agent then searches for a trusted calculation that can answer the question. If it finds one, it runs that code and then reports the result along with a "Verified answer" tag.
+The agent then searches for a trusted calculation that can answer the question. If it finds one, it runs that code and then reports the result with a green verified dot.
> At Oak Bluff, 59 individual animals were observed across 5 species, based on 28 hours of survey effort. Note this reflects observed individuals during surveys, not necessarily a full census of every animal present at the site.
>
-> `r commons:::commons_answer_pill("A")`
+> `r commons:::commons_answer_dot("A")`
Although the agent had to decide which trusted calculation to run, it did not have to decide _what code to write_, reducing degrees of freedom and allowing it to take advantage of pre-vetted code.
@@ -69,7 +69,7 @@ file.copy(skill, ".claude/skills", recursive = TRUE)
## Trust flow
-commons agents will use trusted calculations whenever possible. When the user asks a question, the agent first searches the semantic layer for a trusted calculation. If it finds one, it then calls that calculation and the resulting answer is tagged with a green verified answer pill.
+commons agents will use trusted calculations whenever possible. When the user asks a question, the agent first searches the semantic layer for a trusted calculation. If it finds one, it then calls that calculation and the resulting answer is marked with a green verified dot.
If a relevant trusted calculation is not found, the agent proceeds down the lower trust path. It searches through the context for additional information, then uses that information to write custom SQL or R code to answer the user's question. These answers either include a verified citation in a footnote or are tagged as `Untrusted`.
@@ -92,7 +92,7 @@ If a relevant trusted calculation is not found, the agent proceeds down the lowe
→
Run trusted
calculation
→
-`r commons:::commons_answer_pill("A")`
+`r commons:::commons_answer_dot("A")`
@@ -109,7 +109,7 @@ If a relevant trusted calculation is not found, the agent proceeds down the lowe
Cited answer1
or
-`r commons:::commons_answer_pill("C")`
+`r commons:::commons_answer_dot("C")`
@@ -123,11 +123,11 @@ The following table details the various ways each trust outcome can occur:
| How the answer is produced | Outcome |
|---|---|
-| A trusted R [measure](#semantic-layer) | `r commons:::commons_answer_pill("A")` |
-| A [data-dictionary metric](#definitions), possibly grouped or filtered with [definitions](#data-dictionaries) | `r commons:::commons_answer_pill("A")` |
-| A [Snowflake semantic-view or Databricks metric-view metric](#warehouse-semantic-layers) | `r commons:::commons_answer_pill("A")` |
-| Custom SQL, including SQL that uses [data-dictionary definitions](#definitions) | Cited or `r commons:::commons_answer_pill("C")` |
-| Custom R | Cited or `r commons:::commons_answer_pill("C")` |
+| A trusted R [measure](#semantic-layer) | `r commons:::commons_answer_dot("A")` |
+| A [data-dictionary metric](#definitions), possibly grouped or filtered with [definitions](#data-dictionaries) | `r commons:::commons_answer_dot("A")` |
+| A [Snowflake semantic-view or Databricks metric-view metric](#warehouse-semantic-layers) | `r commons:::commons_answer_dot("A")` |
+| Custom SQL, including SQL that uses [data-dictionary definitions](#definitions) | Cited or `r commons:::commons_answer_dot("C")` |
+| Custom R | Cited or `r commons:::commons_answer_dot("C")` |
| No data tool used (e.g., because the agent already had sufficient information or the question could not be answered from accessible information) | No label |
The agent itself does not tag the answer as verified, cited, or untrusted. This process is instead handled deterministically by the commons package based on the agent's behavior.
diff --git a/pkg-r/vignettes/commons.css b/pkg-r/vignettes/commons.css
index bab7eb98..c8e0a671 100644
--- a/pkg-r/vignettes/commons.css
+++ b/pkg-r/vignettes/commons.css
@@ -1,11 +1,3 @@
-.commons-answer-pill-icon {
- background: transparent;
- border: 0;
- border-radius: 0;
- margin: 0;
- padding: 0;
-}
-
.commons-flow {
margin: 1.5rem 0;
overflow-x: auto;
diff --git a/tests/shared/provenance.json b/tests/shared/provenance.json
index 94c517fc..b7302d17 100644
--- a/tests/shared/provenance.json
+++ b/tests/shared/provenance.json
@@ -1,17 +1,17 @@
{
"description": "Provenance contract shared by pkg-r and pkg-py. The source is tests/shared/provenance.json; the copy under pkg-r/tests/testthat/fixtures/shared/ is generated by scripts/sync-shared-fixtures.sh. Edit the source and re-run that script.",
"derive_provenance_tag": {
- "description": "Truth table for derive_provenance_tag(tags, verified). `tags` holds the commons_tag values appended by tools during one exchange; only A and B are ever emitted as inputs, so C appears only as a derived result. `expected` is null when no pill is shown.",
- "rule": "B beats A: any B in the exchange disqualifies an A unless a citation verified, in which case B. No data tags at all means no pill.",
+ "description": "Truth table for derive_provenance_tag(tags, verified). `tags` holds the commons_tag values appended by tools during one exchange; only A and B are ever emitted as inputs, so C appears only as a derived result. `expected` is null when no provenance marker is shown.",
+ "rule": "B beats A: any B in the exchange disqualifies an A unless a citation verified, in which case B. No data tags at all means no provenance marker.",
"cases": [
{
- "name": "no data tools means no pill",
+ "name": "no data tools means no provenance marker",
"tags": [],
"verified": false,
"expected": null
},
{
- "name": "no data tools means no pill even when something verified",
+ "name": "no data tools means no provenance marker even when something verified",
"tags": [],
"verified": true,
"expected": null
@@ -73,25 +73,25 @@
]
},
"provenance_display": {
- "description": "Word-for-word copy both UIs render. `icon` is null when the pill has no icon.",
+ "description": "Word-for-word copy both UIs render. `icon` and `dot_class` are null when a tag has no standalone provenance marker.",
"tags": {
"A": {
"label": "Verified answer",
"icon": "trusted-icon.svg",
"body": "This answer comes from a governed calculation defined by your data team.",
- "pill_class": "trusted"
+ "dot_class": "verified"
},
"B": {
"label": "Cited",
"icon": null,
"body": "This answer includes supporting text verified against a trusted source.",
- "pill_class": "cited"
+ "dot_class": null
},
"C": {
"label": "Untrusted",
"icon": "warning-icon.svg",
"body": "This answer was not produced by a governed calculation and has no verified supporting citation. AI can be wrong.",
- "pill_class": "caution"
+ "dot_class": "untrusted"
}
}
}