Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1b5eef8
test(codegraph): cover typed and awaited receiver callers
ScriptedAlchemy Nov 10, 2026
4f714bb
docs(context): explain connecting paths and source outcomes
ScriptedAlchemy Nov 10, 2026
b8e0184
feat(codegraph): resolve TypeScript instance receivers
ScriptedAlchemy Nov 10, 2026
366a0b3
fix(codegraph): preserve receiver scope across retained edits
ScriptedAlchemy Nov 10, 2026
9dca64a
feat(context): include connecting call paths and attested source
ScriptedAlchemy Nov 10, 2026
278c24a
refactor(codegraph): simplify receiver and context control flow
ScriptedAlchemy Nov 10, 2026
f7f9911
chore(sdk): regenerate context call path contracts
ScriptedAlchemy Nov 10, 2026
dd35cd8
build(plugin): refresh embedded context call-path schemas
ScriptedAlchemy Nov 11, 2026
f839375
feat(codegraph): follow immutable TypeScript receiver aliases
ScriptedAlchemy Nov 11, 2026
74135c5
fix(context): bound path source reads by admitted request lifetime
ScriptedAlchemy Nov 11, 2026
e52acf7
feat(codegraph): expose bounded unresolved-call evidence
ScriptedAlchemy Nov 11, 2026
d9d463a
feat(plugin): surface unresolved calls in symbol inspection
ScriptedAlchemy Nov 11, 2026
6555b0e
chore(sdk): regenerate unresolved-call report contracts
ScriptedAlchemy Nov 11, 2026
7c5400f
build(plugin): refresh unresolved-call inspection bundles
ScriptedAlchemy Nov 11, 2026
f1a1d19
Merge remote-tracking branch 'origin/master' into pr-4863
ScriptedAlchemy Nov 11, 2026
24cc1b3
fix(codegraph): resolve merge conflicts and failing checks
ScriptedAlchemy Nov 11, 2026
06398bc
Merge origin/master into feat/codegraph-receiver-context
ScriptedAlchemy Nov 11, 2026
8a034b9
test(global-db): remove redundant runtime reopens
ScriptedAlchemy Nov 11, 2026
d0230db
perf(extraction): reuse lexical receiver scope facts
ScriptedAlchemy Nov 11, 2026
6a12929
Merge branch 'master' into feat/codegraph-receiver-context
ScriptedAlchemy Nov 11, 2026
5d27bac
perf(extraction): index receiver scope names once
ScriptedAlchemy Nov 11, 2026
8f22016
fix(mcp): stop context source hydration after cancellation
ScriptedAlchemy Nov 11, 2026
84cda94
fix(mcp): use the context path node method directly
ScriptedAlchemy Nov 12, 2026
9ec3e68
test(global-db): batch overlap reconciliation fixture writes
ScriptedAlchemy Nov 12, 2026
2757f46
Merge origin/master into feat/codegraph-receiver-context
ScriptedAlchemy Nov 12, 2026
f285175
fix(mcp): name graph owner source-cancellation tests
ScriptedAlchemy Nov 13, 2026
2719775
fix(codegraph): retire obsolete seals and refresh generated server
ScriptedAlchemy Nov 13, 2026
818b75f
test(code-index): pin revision 23 manifest fingerprint
ScriptedAlchemy Nov 13, 2026
3191e45
test(global-db): align schema sweep with native runtime
ScriptedAlchemy Nov 13, 2026
8e39573
fix(hooks): follow the current receipt settlement authority
ScriptedAlchemy Nov 13, 2026
1255c5e
test(hooks): retain receipt backlog drain diagnostics
ScriptedAlchemy Nov 13, 2026
40963cd
Merge master into feat/codegraph-receiver-context
ScriptedAlchemy Nov 13, 2026
5992474
style(code-index): format the sealed revision assertion
ScriptedAlchemy Nov 13, 2026
89cf69e
test(hooks): remove temporary receipt drain tracing
ScriptedAlchemy Nov 13, 2026
0f33b35
Merge master and regenerate the ChatGPT server bundle
ScriptedAlchemy Nov 13, 2026
9f46cde
fix(code-extraction): attribute receiver writes to lexical bindings
ScriptedAlchemy Nov 14, 2026
28792e3
test(code-index): preserve sealed receiver shadow ownership
ScriptedAlchemy Nov 14, 2026
e90dac2
style(extraction): format receiver binding condition
ScriptedAlchemy Nov 14, 2026
7004443
chore(codegraph): integrate reviewed runtime fixes
ScriptedAlchemy Nov 14, 2026
0054bb1
fix(sqlite): join failed reader startup before returning pins
ScriptedAlchemy Nov 14, 2026
84a1e07
test(global-db): reuse workflow cancellation baseline
ScriptedAlchemy Nov 14, 2026
e5ca1f3
test(store): measure sealed hydration phases
ScriptedAlchemy Nov 14, 2026
b759f0e
test(store): remove sealed hydration phase capture
ScriptedAlchemy Nov 14, 2026
2a8f480
test(automation): remove completed settlement timing capture
ScriptedAlchemy Nov 14, 2026
7103e3b
build(plugin): integrate current receiver-context bundle inputs
ScriptedAlchemy Nov 14, 2026
393b0e3
test(global-db): avoid unused schema fixture actor startup
ScriptedAlchemy Nov 14, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -1717,15 +1717,6 @@ fn settle_bound_owner_with_budget(
mut state: RetainedBoundSettlement,
budget: Duration,
) -> Result<RetainedOwnerValue<(AutomationSettledTerminal, AutomationRunLedgerRecord)>> {
#[cfg(test)]
let _capture = state.phase_hook.as_ref().map(|_| {
tracedecay_runtime_core::logging::FormattedTracingCapture::start_with_span_timings()
});
#[cfg(test)]
let _capture_span = state.phase_hook.as_ref().map(|_| {
tracing::info_span!("daemon.automation.retained_owner", run_id = %state.ledger.run_id)
.entered()
});
let started = std::time::Instant::now();
let mut delay = Duration::from_millis(25);
loop {
Expand Down
40 changes: 40 additions & 0 deletions crates/tracedecay-code-extraction/src/extraction_artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,39 @@ pub struct ExtractedGoMethodSetRowV1 {
pub row: GoMethodSetRowV1,
}

/// A receiver whose binding is attested by the TypeScript syntax tree.
/// Names are resolved in the declaring file at generation sealing; they
/// never authorize a project-wide same-name method match.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum TypeScriptReceiverV1 {
Named { name: String, constructor: bool },
AwaitedFactory { name: String },
}

/// Minimal type facts needed to bind an instance call without a compiler.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum TypeScriptTypeRowV1 {
/// A callable instance member, excluding constructors, static members,
/// getters, and setters.
InstanceMethod,
/// A single named return type, optionally inside the built-in Promise.
CallableReturn { name: String, promise: bool },
/// The exact callee span of a call through a stable local binding.
ReceiverCall {
span: SourceSpan,
receiver: TypeScriptReceiverV1,
},
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
#[serde(deny_unknown_fields)]
pub struct ExtractedTypeScriptTypeRowV1 {
pub node_id: String,
pub row: TypeScriptTypeRowV1,
}

/// Legacy graph extraction plus structured evidence from the same traversal.
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
Expand All @@ -408,6 +441,10 @@ pub struct ExtractionArtifactV1 {
/// the seal derives implicit interface satisfaction.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub go_method_sets: Vec<ExtractedGoMethodSetRowV1>,
/// TypeScript receiver and callable-return evidence. Empty for every
/// other language, so it does not change their serialized bytes.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub typescript_types: Vec<ExtractedTypeScriptTypeRowV1>,
}

impl ExtractionArtifactV1 {
Expand All @@ -419,6 +456,7 @@ impl ExtractionArtifactV1 {
schema_evidence: None,
callable_arities: Vec::new(),
go_method_sets: Vec::new(),
typescript_types: Vec::new(),
}
}

Expand All @@ -439,6 +477,8 @@ impl ExtractionArtifactV1 {
crate::clone_body::canonicalize_clone_body_order(&mut self.clone_bodies);
self.callable_arities.sort();
self.go_method_sets.sort();
self.typescript_types.sort();
self.typescript_types.dedup();
if let Some(evidence) = &mut self.schema_evidence {
evidence.canonicalize_order();
}
Expand Down
14 changes: 14 additions & 0 deletions crates/tracedecay-code-extraction/src/incremental/extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,27 @@ fn merge_changed_artifact_unmeasured(
.cloned()
.collect::<Vec<_>>();
go_method_sets.extend(delta.go_method_sets);
let mut typescript_types = previous
.typescript_types
.iter()
.filter(|row| !superseded.contains(row.node_id.as_str()))
.cloned()
.map(|mut row| {
if let crate::TypeScriptTypeRowV1::ReceiverCall { span, .. } = &mut row.row {
*span = shift_unaffected_span(*span, edit)?.0;
}
Some(row)
})
.collect::<Option<Vec<_>>>()?;
typescript_types.extend(delta.typescript_types);
let mut artifact = ExtractionArtifactV1 {
result,
imports,
clone_bodies,
schema_evidence: None,
callable_arities,
go_method_sets,
typescript_types,
};
artifact.canonicalize_order();
Some(artifact)
Expand Down
8 changes: 4 additions & 4 deletions crates/tracedecay-code-extraction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ pub use csharp_extractor::CSharpExtractor;
pub use extraction_artifact::{
CallableArityV1, ExtractedCallableArityV1, ExtractedGoMethodSetRowV1,
ExtractedImportEvidenceV1, ExtractedSchemaEvidenceV1, ExtractedSchemaFactV1,
ExtractionArtifactV1, GoMethodSetRowV1, GoMethodSignatureV1, GoTypeTokenV1, GoTypeV1,
ImportModuleKindV1, ImportNamespaceV1, ImportReexportScopeV1, SchemaEvidenceIssueV1,
SchemaEvidenceLanguageV1, SchemaEvidenceStatusV1, SqlSchemaActionV1, SqlSchemaObjectKindV1,
import_module_kind,
ExtractedTypeScriptTypeRowV1, ExtractionArtifactV1, GoMethodSetRowV1, GoMethodSignatureV1,
GoTypeTokenV1, GoTypeV1, ImportModuleKindV1, ImportNamespaceV1, ImportReexportScopeV1,
SchemaEvidenceIssueV1, SchemaEvidenceLanguageV1, SchemaEvidenceStatusV1, SqlSchemaActionV1,
SqlSchemaObjectKindV1, TypeScriptReceiverV1, TypeScriptTypeRowV1, import_module_kind,
};
pub use go_extractor::GoExtractor;
pub use java_extractor::JavaExtractor;
Expand Down
1 change: 1 addition & 0 deletions crates/tracedecay-code-extraction/src/parsed_extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub enum ParsedExtractionResetReason {
LanguageChanged,
MissingPriorExtraction,
MultilineEdit,
ModuleBindingsChanged,
PartialParse,
}

Expand Down
1 change: 1 addition & 0 deletions crates/tracedecay-code-extraction/src/proto_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ impl ProtoExtractor {
clone_bodies: Vec::new(),
callable_arities: Vec::new(),
go_method_sets: Vec::new(),
typescript_types: Vec::new(),
schema_evidence: Some(ExtractedSchemaEvidenceV1 {
logical_path: state.file_path,
language: SchemaEvidenceLanguageV1::Protobuf,
Expand Down
1 change: 1 addition & 0 deletions crates/tracedecay-code-extraction/src/rust_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,7 @@ impl RustExtractor {
schema_evidence: None,
callable_arities: state.callable_arities,
go_method_sets: Vec::new(),
typescript_types: Vec::new(),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/tracedecay-code-extraction/src/sql_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ impl SqlExtractor {
clone_bodies: Vec::new(),
callable_arities: Vec::new(),
go_method_sets: Vec::new(),
typescript_types: Vec::new(),
schema_evidence: Some(ExtractedSchemaEvidenceV1 {
logical_path: state.file_path,
language: SchemaEvidenceLanguageV1::Sql,
Expand Down
47 changes: 45 additions & 2 deletions crates/tracedecay-code-extraction/src/typescript_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use tree_sitter::{Node as TsNode, Tree};

use crate::common::{declaration_start, local_node_id};
use crate::complexity::{TYPESCRIPT_COMPLEXITY, count_complexity};
use crate::extraction_artifact::{ExtractedImportEvidenceV1, ExtractionArtifactV1};
use crate::extraction_artifact::{
ExtractedImportEvidenceV1, ExtractedTypeScriptTypeRowV1, ExtractionArtifactV1,
};
use crate::traversal::find_direct_child_by_kind;
use crate::types::{
ComplexityAnalysisV1, Edge, EdgeKind, ExtractionResult, Node, NodeKind, UnresolvedRef,
Expand All @@ -17,6 +19,7 @@ use crate::types::{

mod imports;
mod module_references;
mod receiver_types;
mod string_literals;
mod test_calls;

Expand Down Expand Up @@ -46,6 +49,7 @@ struct ExtractionState<'s> {
unresolved_refs: Vec<UnresolvedRef>,
errors: Vec<String>,
imports: Vec<ExtractedImportEvidenceV1>,
typescript_types: Vec<ExtractedTypeScriptTypeRowV1>,
/// Stack of (name, `node_id`) for building qualified names and parent edges.
node_stack: Vec<(String, String)>,
file_path: String,
Expand All @@ -64,6 +68,7 @@ impl<'s> ExtractionState<'s> {
unresolved_refs: Vec::new(),
errors: Vec::new(),
imports: Vec::new(),
typescript_types: Vec::new(),
node_stack: Vec::new(),
file_path: file_path.to_string(),
source: source.as_bytes(),
Expand Down Expand Up @@ -151,6 +156,25 @@ impl TypeScriptExtractor {
tree: &Tree,
scope: crate::parsed_extraction::ParsedExtractionScope<'_>,
) -> crate::parsed_extraction::ParsedExtractionArtifactV1 {
if matches!(
scope,
crate::parsed_extraction::ParsedExtractionScope::ChangedRegions(_)
) {
// Receiver proof reads lexical module bindings and writes in
// sibling declarations. Reuse the retained tree, but re-extract
// this file so an edit outside a caller cannot retain stale proof.
let mut full = Self::extract_tree_artifact(
file_path,
source,
tree,
crate::parsed_extraction::ParsedExtractionScope::FullDocument,
);
full.disposition = crate::parsed_extraction::ParsedExtractionDisposition::Reset {
reason:
crate::parsed_extraction::ParsedExtractionResetReason::ModuleBindingsChanged,
};
return full;
}
let start = Instant::now();
let mut state = ExtractionState::new(file_path, source);

Expand Down Expand Up @@ -627,6 +651,7 @@ impl TypeScriptExtractor {
}

Self::extract_type_refs(state, node, &id);
receiver_types::record_callable(state, node, &id, false);

// The body and default parameter values (`x = defaults()`) run on
// each call.
Expand Down Expand Up @@ -740,6 +765,7 @@ impl TypeScriptExtractor {
}

Self::extract_type_refs(state, arrow_node, &id);
receiver_types::record_callable(state, arrow_node, &id, false);

// Extract call sites from the arrow function body. Block-bodied arrows
// (`() => { ... }`) have a `statement_block`; expression-bodied arrows
Expand Down Expand Up @@ -988,6 +1014,10 @@ impl TypeScriptExtractor {
}

Self::extract_type_refs(state, node, &id);
let instance = node
.child_by_field_name("name")
.is_some_and(|name| state.node_text(name) != "constructor");
receiver_types::record_callable(state, node, &id, instance);

// Default parameter values and the body run on each call.
Self::extract_owned_call_sites(state, node, &id);
Expand Down Expand Up @@ -1213,6 +1243,7 @@ impl TypeScriptExtractor {
parent_id: None,
};
state.nodes.push(graph_node);
receiver_types::record_callable(state, node, &id, true);

if let Some(parent_id) = state.parent_node_id() {
state.edges.push(Edge {
Expand Down Expand Up @@ -1659,6 +1690,16 @@ impl TypeScriptExtractor {
/// enclosing symbol. A JSX element naming a component (`<Card />`,
/// `<Layout.Header>`) renders, and so calls, that component.
fn extract_call_sites(state: &mut ExtractionState<'_>, node: TsNode<'_>, fn_node_id: &str) {
let mut lookup = receiver_types::ReceiverLookup::default();
Self::extract_call_sites_with_lookup(state, node, fn_node_id, &mut lookup);
}

fn extract_call_sites_with_lookup<'t>(
state: &mut ExtractionState<'_>,
node: TsNode<'t>,
fn_node_id: &str,
lookup: &mut receiver_types::ReceiverLookup<'t>,
) {
let mut cursor = node.walk();
if cursor.goto_first_child() {
loop {
Expand All @@ -1679,6 +1720,7 @@ impl TypeScriptExtractor {
_ => None,
};
if let Some((callee, site)) = callee {
receiver_types::record_call(state, callee, fn_node_id, lookup);
state.unresolved_refs.push(UnresolvedRef {
from_node_id: fn_node_id.to_string(),
reference_name: state.node_text(callee).to_string(),
Expand All @@ -1690,7 +1732,7 @@ impl TypeScriptExtractor {
argument_count: None,
});
}
Self::extract_call_sites(state, child, fn_node_id);
Self::extract_call_sites_with_lookup(state, child, fn_node_id, lookup);
if !cursor.goto_next_sibling() {
break;
}
Expand Down Expand Up @@ -2038,6 +2080,7 @@ impl TypeScriptExtractor {
schema_evidence: None,
callable_arities: Vec::new(),
go_method_sets: Vec::new(),
typescript_types: state.typescript_types,
}
}
}
Expand Down
Loading
Loading