Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
835291a
perf(sessions): bound non-transcript Codex directory enumeration
ScriptedAlchemy Nov 10, 2026
0390a59
perf(sessions): exclude ignored archive names from Codex probes
ScriptedAlchemy Nov 10, 2026
b71eb2b
style(sessions): match pinned rustfmt on Codex regressions
ScriptedAlchemy Nov 10, 2026
3912dd4
perf(sessions): bound Codex name witness to discovery slices
ScriptedAlchemy Nov 10, 2026
2598f10
fix(sessions): repair Codex incremental scanner compilation
ScriptedAlchemy Nov 10, 2026
4b3e4ba
fix(sessions): borrow Codex directory stat for witness
ScriptedAlchemy Nov 10, 2026
1fc5852
fix(sessions): refuse changed Codex directory sweep coverage
ScriptedAlchemy Nov 10, 2026
0978194
test(sessions): retain sources from invalidated Codex sweep
ScriptedAlchemy Nov 10, 2026
3c99fb0
fix(sessions): fence Codex directory identity across chunks
ScriptedAlchemy Nov 10, 2026
a2cf71a
style(sessions): format directory-sweep witness assertions
ScriptedAlchemy Nov 10, 2026
cfa88fa
style(sessions): format bounded Codex scan regression
ScriptedAlchemy Nov 10, 2026
ecc476e
fix(sessions): refuse incomplete coarse-clock Codex sweeps
ScriptedAlchemy Nov 11, 2026
0d4be4e
fix(sessions): fence bounded Codex file walk coverage
ScriptedAlchemy Nov 11, 2026
32805e4
fix(sessions): verify unsettled Codex directory listings
ScriptedAlchemy Nov 11, 2026
294ea91
fix(sessions): verify originally unsettled Codex buckets
ScriptedAlchemy Nov 11, 2026
527319c
style(sessions): format Codex verification traversal
ScriptedAlchemy Nov 11, 2026
659a07a
fix(sessions): keep Codex sweep witnesses stable across clock settle
ScriptedAlchemy Nov 11, 2026
d0251dd
fix(sessions): fence Codex verification clock transitions
ScriptedAlchemy Nov 11, 2026
a41f598
fix(sessions): refuse incomplete chunked Codex coverage
ScriptedAlchemy Nov 11, 2026
0c88051
fix(sessions): fence chunked Codex clock transitions
ScriptedAlchemy Nov 11, 2026
fe3bf36
Merge master into fix/4756-codex-directory-entry-budget-20261110
ScriptedAlchemy Nov 11, 2026
e891f50
test(global-db): retire cancellation fixture before reopening
ScriptedAlchemy Nov 11, 2026
b2f65b1
test(global-db): batch overlap reconciliation fixture writes
ScriptedAlchemy Nov 12, 2026
96bb006
chore(sessions): integrate master into Codex traversal
ScriptedAlchemy Nov 12, 2026
da7b91f
fix(sessions): deduplicate Codex witness test imports
ScriptedAlchemy Nov 12, 2026
cb684f7
test(sessions): make coarse fingerprint regression deterministic
ScriptedAlchemy Nov 12, 2026
7a61262
test(dashboard): bind cancellation checks to the owned listener
ScriptedAlchemy Nov 13, 2026
1c48459
test(db): reuse published schema for cancellation sweep
ScriptedAlchemy Nov 13, 2026
6fcad5e
test(sessions): capture compaction publication diagnostics
ScriptedAlchemy Nov 13, 2026
d749b16
test(lsp): capture receipt admission phases on ACK failure
ScriptedAlchemy Nov 13, 2026
cf5fad3
test(code-index): use native runtime for generation cursor journey
ScriptedAlchemy Nov 13, 2026
ce341e5
test(global-db): use native runtime for cancellation sweep
ScriptedAlchemy Nov 13, 2026
b61d9d9
test(sessions): remove temporary acceptance tracing
ScriptedAlchemy Nov 13, 2026
b7c65ab
Merge master into repair branch
ScriptedAlchemy Nov 13, 2026
408a89e
test(sessions): start archive fingerprint with its iterator
ScriptedAlchemy Nov 13, 2026
a50b826
test(mcp): keep routed serve sessions off the async worker
ScriptedAlchemy Nov 13, 2026
6a8f155
test(cli): wait for typed diagnostics discovery
ScriptedAlchemy Nov 13, 2026
df5c1ed
test(sessions): settle archive before bounded traversal
ScriptedAlchemy Nov 13, 2026
37dd630
test(daemon): observe reconciled text for edit hooks
ScriptedAlchemy Nov 13, 2026
bac6a37
chore(feedback): trace observation writes and terminal drain
ScriptedAlchemy Nov 13, 2026
c42606c
test(daemon): capture deadline route shutdown phases
ScriptedAlchemy Nov 13, 2026
3f745b6
style(daemon): wrap shutdown drain result
ScriptedAlchemy Nov 13, 2026
416dbc2
Merge master into Codex traversal repairs
ScriptedAlchemy Nov 13, 2026
613aabb
style: format shutdown measurement and hook readiness
ScriptedAlchemy Nov 14, 2026
dab11b7
test(daemon): use static filters for shutdown measurement
ScriptedAlchemy Nov 14, 2026
0ecb01b
style: format shutdown capture targets
ScriptedAlchemy Nov 14, 2026
cf1d97a
test(daemon): remove shutdown capture after measurement
ScriptedAlchemy Nov 14, 2026
df62f25
test(daemon): use native runtime for capacity journeys
ScriptedAlchemy Nov 14, 2026
09ef40a
test(daemon): compare status within one paused attempt
ScriptedAlchemy Nov 14, 2026
41f5506
chore: integrate validated master into codex traversal fixes
ScriptedAlchemy Nov 14, 2026
544a7e9
test: capture automation ledger append subphases
ScriptedAlchemy Nov 14, 2026
8a48a71
test: remove completed automation append measurement
ScriptedAlchemy Nov 14, 2026
82800ba
chore: integrate current master into codex traversal fixes
ScriptedAlchemy Nov 14, 2026
cc50a0f
test(runtime): retain the last restart readiness observation
ScriptedAlchemy Nov 14, 2026
816d6ec
chore: integrate validated ledger diagnostics
ScriptedAlchemy Nov 14, 2026
6c6ce76
chore: integrate retention baseline for session traversal
ScriptedAlchemy Nov 14, 2026
260ca98
chore: integrate beta 103 baseline for session traversal
ScriptedAlchemy Nov 14, 2026
9cf5ef7
chore: integrate release runner authority for session traversal
ScriptedAlchemy Nov 14, 2026
92b2a78
test(global-db): avoid unused raw fixture connections
ScriptedAlchemy Nov 14, 2026
74f4a86
test(global-db): assert initialization refusal directly
ScriptedAlchemy Nov 14, 2026
7c42cb9
chore(sessions): integrate merged submodule indexing
ScriptedAlchemy Nov 14, 2026
23704e2
chore(sessions): integrate corrected database fixtures
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
52 changes: 41 additions & 11 deletions crates/tracedecay-application/src/feedback/concrete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use tracedecay_domain::{
};
use tracedecay_store::DiagnosticStore;
use tracedecay_tool_catalog::{CapabilityId, UseCaseId};
use tracing::Instrument;

use super::concrete_evidence::{complete, cursor_refused, interruption, unavailable};
use super::observations::{
Expand Down Expand Up @@ -294,11 +295,24 @@ impl ProjectFeedbackObservationSinkV1 {
Ok(())
}

#[tracing::instrument(name = "usecases.feedback.close_drain", level = "trace", skip_all)]
#[tracing::instrument(
name = "usecases.feedback.close_drain",
level = "trace",
skip_all,
fields(producer_boot_id = %self.boot_id)
)]
async fn join_worker(&self) -> Result<(), FeedbackRuntimeError> {
let mut worker = self.worker.lock().await;
let mut worker = self
.worker
.lock()
.instrument(tracing::trace_span!("usecases.feedback.close_drain.lock"))
.await;
let outcome = match worker.as_ref() {
Some(task) => match task.wait().await {
Some(task) => match task
.wait()
.instrument(tracing::trace_span!("usecases.feedback.close_drain.worker"))
.await
{
NativeTaskOutcome::Completed(Ok(())) => Ok(()),
NativeTaskOutcome::Completed(Err(())) => Err(FeedbackRuntimeError::Store),
NativeTaskOutcome::Cancelled | NativeTaskOutcome::Panicked(_) => {
Expand Down Expand Up @@ -1783,7 +1797,11 @@ fn interruption_outcome(context: &RequestContext, observed_at: UtcMicros) -> Fee
#[tracing::instrument(
name = "usecases.feedback.persist_observation",
level = "trace",
skip_all
skip_all,
fields(
producer_boot_id = ?envelope.producer_boot_id,
producer_sequence = ?envelope.producer_sequence
)
)]
async fn persist_feedback_observation(
database: &Database,
Expand All @@ -1794,9 +1812,12 @@ async fn persist_feedback_observation(
}
let transaction = database
.begin_write_transaction("record feedback observation")
.instrument(tracing::trace_span!("usecases.feedback.writer_admission"))
.await
.map_err(|_| FeedbackRuntimeError::Store)?;
let mut ledger = load_observation_ledger(&transaction).await?;
let mut ledger = load_observation_ledger(&transaction)
.instrument(tracing::trace_span!("usecases.feedback.load_ledger"))
.await?;
if ledger
.observations
.iter()
Expand Down Expand Up @@ -1850,18 +1871,27 @@ async fn persist_feedback_observation(
}
ledger.observations.push(envelope);
ledger.schema_version = OBSERVATION_LEDGER_SCHEMA_VERSION;
let encoded = encode_bounded_observation_ledger(
&mut ledger,
MAX_STORED_OBSERVATIONS,
MAX_STORED_OBSERVATION_BOOTS,
MAX_OBSERVATION_LEDGER_BYTES,
)?;
let encoded = tracing::trace_span!(
"usecases.feedback.encode_ledger",
observations = ledger.observations.len(),
boots = ledger.producer_boots.len()
)
.in_scope(|| {
encode_bounded_observation_ledger(
&mut ledger,
MAX_STORED_OBSERVATIONS,
MAX_STORED_OBSERVATION_BOOTS,
MAX_OBSERVATION_LEDGER_BYTES,
)
})?;
database
.set_metadata_unguarded(&transaction, OBSERVATION_LEDGER_METADATA_KEY, &encoded)
.instrument(tracing::trace_span!("usecases.feedback.persist_ledger"))
.await
.map_err(|_| FeedbackRuntimeError::Store)?;
transaction
.commit()
.instrument(tracing::trace_span!("usecases.feedback.commit"))
.await
.map_err(|_| FeedbackRuntimeError::Store)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,17 @@ async fn persistent_graph_activation_publishes_a_small_generation() {
.expect("join graph reconciliation tasks");
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn persistent_callers_cursor_keeps_generation_a_without_repointing_generation_b() {
#[test]
fn persistent_callers_cursor_keeps_generation_a_without_repointing_generation_b() {
// Native tasks inherit this runtime, including the daemon's wake policy.
tracedecay_runtime_core::native_runtime::default_builder()
.worker_threads(2)
.build()
.expect("persistent graph cursor runtime")
.block_on(persistent_callers_cursor_across_generations());
}

async fn persistent_callers_cursor_across_generations() {
let fixture = GitFixture::new(&[(
"src/lib.rs",
"pub fn hub() {}\npub fn caller_a() { hub(); }\npub fn caller_b() { hub(); }\n",
Expand Down
24 changes: 19 additions & 5 deletions crates/tracedecay-dashboard-api/src/server_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn loopback_server_drains_in_flight_request_after_shutdown() {

/// Cancelling the listener must abort the connection tasks it owns, including
/// a handler that cannot finish gracefully.
#[tokio::test]
#[tokio::test(flavor = "current_thread")]
async fn cancelling_the_loopback_server_drops_its_open_connections() {
use tokio::io::{AsyncReadExt, AsyncWriteExt};

Expand Down Expand Up @@ -122,16 +122,30 @@ async fn cancelling_the_loopback_server_drops_its_open_connections() {
.await
.expect("the connection must admit the held handler");

// Connect without yielding this current-thread runtime, so the socket
// remains in this listener's accept backlog when cancellation lands.
// Reconnecting after shutdown could reach another test that reused the
// ephemeral port and would not identify the listener being checked.
let queued_peer = TcpStream::connect_timeout(&address, bound).unwrap();
queued_peer.set_nonblocking(true).unwrap();
let mut queued_peer = tokio::net::TcpStream::from_std(queued_peer).unwrap();
server.abort();
assert!(server.await.unwrap_err().is_cancelled());
tokio::time::timeout(bound, dropped.notified())
.await
.expect("listener cancellation must drop its active handler");
// The joined task has dropped the listener it exclusively owned. Its
// ephemeral address may already belong to another parallel test, so a new
// connection cannot identify that listener. Observe the original accepted
// connection below instead.
let mut byte = [0];
let queued_received = tokio::time::timeout(bound, queued_peer.read(&mut byte))
.await
.expect("listener cancellation must close its unaccepted socket");
assert!(
matches!(queued_received, Ok(0))
|| matches!(queued_received, Err(ref error) if matches!(
error.kind(),
std::io::ErrorKind::ConnectionReset | std::io::ErrorKind::ConnectionAborted
)),
"the cancelled listener must close its backlog: {queued_received:?}"
);
let received = tokio::time::timeout(bound, peer.read(&mut byte))
.await
.expect("listener cancellation must close its accepted socket");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async fn legacy_profile_requires_reset_without_carrying_session_content_forward(
let db_path = tmp.path().join(".tracedecay").join("sessions.db");
create_legacy_sessions_db(&db_path).await;

let error = match open_global_db(&db_path).await {
let error = match initialize_global_db(&db_path).await {
Err(error) => error,
Ok(_) => panic!("legacy session content must require an explicit profile reset"),
};
Expand All @@ -31,8 +31,9 @@ async fn stale_or_future_lcm_marker_requires_reset_without_rewriting_marker() {
] {
let tmp = TempDir::new().unwrap();
let db_path = tmp.path().join(".tracedecay").join("sessions.db");
let db = open_global_db(&db_path).await.expect("fresh global db");
drop(db);
initialize_global_db(&db_path)
.await
.expect("fresh global db");
set_migration_version(&db_path, found_version).await;

let (lease, owner) = open_registered_test_database_fixture(
Expand Down
5 changes: 0 additions & 5 deletions crates/tracedecay-global-db/src/tests/lcm_schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ async fn initialize_global_db(db_path: &Path) -> tracedecay_domain::errors::Resu
Ok(())
}

async fn open_global_db(db_path: &Path) -> tracedecay_domain::errors::Result<TestConnection> {
initialize_global_db(db_path).await?;
Ok(TestConnection::open(db_path))
}

async fn open_read_only_global_db(
db_path: &Path,
) -> tracedecay_domain::errors::Result<Option<(DatabaseAuthority, Database)>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ async fn fresh_temporal_schema_stores_and_searches_a_summary_node() {
let tmp = TempDir::new().unwrap();
let db_path = tmp.path().join(".tracedecay").join("sessions.db");

let db = open_global_db(&db_path)
initialize_global_db(&db_path)
.await
.expect("temporal schema initialization should not error");
drop(db);
assert!(
table_exists(&db_path, "lcm_raw_messages").await,
"fresh initialization must compose the final temporal and LCM schemas"
Expand Down Expand Up @@ -622,7 +621,7 @@ async fn temporal_schema_rejects_unexpected_indexes_without_dropping_them() {
drop(conn);
drop(raw_db);

let error = match open_global_db(&db_path).await {
let error = match initialize_global_db(&db_path).await {
Ok(_) => panic!("unexpected temporal indexes must require reset"),
Err(error) => error,
};
Expand Down Expand Up @@ -675,7 +674,7 @@ async fn temporal_schema_refuses_markerless_malformed_fts_without_mutation() {
drop(raw_db);
let before_catalog = temporal_schema_object_catalog(&db_path).await;

let error = match open_global_db(&db_path).await {
let error = match initialize_global_db(&db_path).await {
Ok(_) => panic!("a markerless malformed FTS store must require reset"),
Err(error) => error,
};
Expand Down Expand Up @@ -743,7 +742,7 @@ async fn temporal_schema_rejects_missing_fts_without_rebuilding_it() {
drop(conn);
drop(raw_db);

let error = match open_global_db(&db_path).await {
let error = match initialize_global_db(&db_path).await {
Ok(_) => panic!("missing temporal FTS objects must require reset"),
Err(error) => error,
};
Expand Down Expand Up @@ -798,7 +797,7 @@ async fn temporal_schema_rejects_missing_graph_publication_authority_without_reb
drop(conn);
drop(raw_db);

let error = match open_global_db(&db_path).await {
let error = match initialize_global_db(&db_path).await {
Ok(_) => panic!("missing graph publication authority must require reset"),
Err(error) => error,
};
Expand Down
Loading
Loading