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 crates/tracedecay-cli/src/status_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ async fn handle_status_command_within(
.unwrap_or_default();
let github_source: Option<GitHubSourceStatusV1> = daemon_status
.get("github_source")
.filter(|source| source.get("state") != Some(&Value::from("not_observed")))
.filter(|source| source.get("state") != Some(&Value::from("absent")))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Continue accepting the previous not_observed response

When the updated CLI connects to a still-running daemon built from the parent revision, that daemon returns the placeholder { "state": "not_observed", ... }. Because this filter now excludes only absent, the placeholder is passed to serde_json::from_value::<GitHubSourceStatusV1>, which fails on the missing repository field and makes plain tracedecay status exit with an error during version skew. Filter both placeholder states, or decode them through a compatible typed response.

Useful? React with 👍 / 👎.

.cloned()
.map(serde_json::from_value)
.transpose()?;
Expand Down
2 changes: 1 addition & 1 deletion crates/tracedecay-mcp/src/handlers/info/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ pub async fn handle_status(
output["github_source"] = match github_source_status_v1(ctx.project_root()) {
Some(source) => serde_json::to_value(&source)?,
None => json!({
"state": "not_observed",
"state": "absent",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the unmounted state instead of claiming absence

When a checkout has a GitHub origin but its full advisory owner has not mounted—such as when indexing is disabled or there are no indexable files—github_source_status_v1 still returns None. This branch now reports state: "absent" even though the source exists, conflating an unavailable authority with a definitive absence; the reason on the next line explicitly acknowledges this second scenario. Keep an unmounted/not-observed state distinct from a checkout that actually lacks an origin.

AGENTS.md reference: AGENTS.md:L228-L229

Useful? React with 👍 / 👎.

"reason": "the checkout has no GitHub origin, or its advisory owner has not mounted in this daemon",
}),
};
Expand Down
8 changes: 8 additions & 0 deletions crates/tracedecay/tests/mcp_suite/status_behavior_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ async fn tracedecay_status_reports_the_sealed_branch_and_keeps_diagnostics_opt_i
assert!(compact.get("node_count").is_none());
assert_eq!(compact["server"]["errors"], 0);
assert!(compact["server"].get("worktree_mismatch").is_none());
assert_eq!(
compact["github_source"],
json!({
"state": "absent",
"reason": "the checkout has no GitHub origin, or its advisory owner has not mounted in this daemon",
})
);

let worktree_id = &compact["code_index_freshness"]["worktree"]["worktree_id"];
let generation_id = &compact["graph_statistics"]["generation_id"];
Expand Down Expand Up @@ -280,6 +287,7 @@ async fn tracedecay_status_reports_the_sealed_branch_and_keeps_diagnostics_opt_i
"## Project Status\n\
**active_branch:** status-proof\n\
**code_index_freshness.status:** current\n\
**github_source:** {{2 field(s)}}\n\
**graph_statistics:** {{6 field(s)}}\n\
**memory.status:** nominal\n\
{owner_bullets}\
Expand Down
1 change: 1 addition & 0 deletions docs/USER-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ checkout's exact head, and a remedy when there is one:
| `bound` | A credential authorizes the reads. |
| `unauthenticated_public` | No credential was found, so the repository is read anonymously as a public repository. That allows 60 requests per hour. Discovery uses the REST issue search's `head:` qualifier, which also finds fork-headed pull requests. |
| `denied_no_credential` | No credential was found and GitHub refused the anonymous read: the repository is private or absent. Run `gh auth login`, or set `GH_TOKEN` to a token with read access, then reopen the project. |
| `absent` | No GitHub source was observed: the checkout has no GitHub `origin`, or its advisory owner has not mounted in this daemon yet. |

### Private GitHub review sources

Expand Down
Loading