Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg-r/R/chat.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' streams, and rewrites verified citations inline as server-authored
#' `<shiny-aside>` elements. Citation details name the
#' trusted source. A provenance marker `<shiny-aside>` follows
#' the answer when it was produced by a governed calculation, or when a
#' the answer when it was produced by a trusted calculation, or when a
#' fallback answer cites nothing verified.
#'
#' @examples
Expand Down
4 changes: 2 additions & 2 deletions pkg-r/R/measures.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Create a semantic layer
#'
#' `semantic_layer()` collects governed R measures for a [commons()] agent.
#' `semantic_layer()` collects trusted calculations for a [commons()] agent.
#' Data dictionary definitions and warehouse semantic models contribute through
#' [data_source()].
#'
Expand Down Expand Up @@ -125,7 +125,7 @@ expand_measures <- function(args, env = rlang::caller_env()) {

#' Create a measure
#'
#' A measure is a governed calculation inside a [semantic_layer()]. Its function
#' A measure is a trusted calculation inside a [semantic_layer()]. Its function
#' body is ordinary R; its `arguments` schema tells the model what inputs it can
#' supply.
#'
Expand Down
4 changes: 2 additions & 2 deletions pkg-r/R/provenance.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ provenance_display <- list(
label = "Verified answer",
icon = "trusted-icon.svg",
body = paste(
"This answer comes from a governed calculation defined by",
"This answer comes from a trusted calculation defined by",
"your data team."
),
pill_class = "trusted"
Expand All @@ -18,7 +18,7 @@ provenance_display <- list(
label = "Untrusted",
icon = "warning-icon.svg",
body = paste(
"This answer was not produced by a governed calculation and has",
"This answer was not produced by a trusted calculation and has",
"no verified supporting citation. AI can be wrong."
),
pill_class = "caution"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The task is to move recurring questions to the highest appropriate path, increas

```text
Path A: semantic layer
The answer comes from a governed `measure()`. Prefer this for stable, recurring business metrics.
The answer comes from a trusted calculation such as a `measure()`. Prefer this for stable, recurring business metrics.

Path B, documented
The answer uses SQL, but the context layer identifies the right table, grain, filters, joins, caveats, or SQL shape. If there are recurring cases in this bucket, consider proposing changes to the semantic layer that would promote those cases into Path A.
Expand Down Expand Up @@ -82,7 +82,7 @@ Files in a Posit Connect app's working directory are replaced on redeployment. U
4. Propose changes.
Present the highest-value changes first. For each proposal, note the theme and current typical path, how many questions are described by that theme, and the recommended change.

Prefer semantic layer edits when the question is a stable governed metric. Prefer context layer edits when the issue is table choice, grain, filters, joins, caveats, terminology, or reusable SQL shape.
Prefer semantic layer edits when the question calls for a stable trusted calculation. Prefer context layer edits when the issue is table choice, grain, filters, joins, caveats, terminology, or reusable SQL shape.

Classify each proposal the same way the extraction reference does, so the two skills reconcile against existing context identically:
* **new** — add it.
Expand Down
2 changes: 1 addition & 1 deletion pkg-r/inst/www/commons-chat/commons-chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ shiny-chat-container .shiny-chat-input .tiptap {
/* Citations are labeled identity asides: shinychat accumulates those
* sharing a paragraph into one pill with a "+N" overflow and a carousel
* popover. They render icon-only like the provenance markers, in a quieter
* mid navy — verified support, short of a governed calculation. */
* mid navy — verified support, short of a trusted calculation. */
shiny-chat-container
.shiny-aside-pill:has(img[src$="/citation-mark.svg"]) {
--shiny-chat-aside-marker-color: #2e4a6b;
Expand Down
2 changes: 1 addition & 1 deletion pkg-r/man/commons_app.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg-r/man/measure.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg-r/man/semantic_layer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg-r/tests/testthat/test-citation-browser.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ test_that("Shiny Chat distinguishes verified, cited, and untrusted asides", {
expect_no_match(verified, "Verified answer", fixed = TRUE)
expect_match(
verified,
"This answer comes from a governed calculation defined by your data team.",
"This answer comes from a trusted calculation defined by your data team.",
fixed = TRUE
)
})
Expand Down
10 changes: 9 additions & 1 deletion pkg-r/tests/testthat/test-provenance.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ test_that("derive_provenance_tag matches the shared truth table", {
}
})

test_that("provenance_display matches the shared copy word for word", {
test_that("provenance_display uses R display copy", {
display <- shared_fixture("provenance")$provenance_display$tags
display$A$body <- paste(
"This answer comes from a trusted calculation defined by",
"your data team."
)
display$C$body <- paste(
"This answer was not produced by a trusted calculation and has",
"no verified supporting citation. AI can be wrong."
)
expect_setequal(names(display), names(provenance_display))

for (tag in names(display)) {
Expand Down
4 changes: 2 additions & 2 deletions pkg-r/tests/testthat/test-trajectory-review.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test_that("provenance markers describe trusted, cited, and uncited answers", {
uncited <- htmltools::renderTags(commons_answer_pill("C"))$html

expect_match(trusted, "Verified answer")
expect_match(trusted, "governed calculation")
expect_match(trusted, "trusted calculation")
expect_match(trusted, "commons-tooltip")
expect_match(trusted, "commons-answer-pill-icon")
expect_match(trusted, "commons-answer-pill-trusted")
Expand All @@ -101,7 +101,7 @@ test_that("provenance markers describe trusted, cited, and uncited answers", {

expect_match(uncited, "Untrusted")
expect_match(uncited, "AI can be wrong")
expect_match(uncited, "not produced by a governed calculation")
expect_match(uncited, "not produced by a trusted calculation")
expect_match(uncited, "commons-tooltip")
expect_match(uncited, "commons-answer-pill-icon")
expect_match(uncited, "commons-answer-pill-caution")
Expand Down
Loading