Repository navigation
Bridge checker: read a MATLAB transpose as a transpose; bridge sqlitedb's 8 public statics - #91
Merged
Merged
Conversation
…USY/READONLY retry
Brings the three entries bin/check_bridge_coverage.py reported against
DID-matlab main back in sync.
timestamp (new, DID-matlab bb29861): did.fun.timestamp(raw=None) returns
the current UTC time as 'yyyy-mm-ddTHH:MM:SS.fffZ' and clamps a ':60'
leap second (with or without a fraction or trailing Z) to ':59.999' with
MATLAB's regex.
document (bb29861): Document stamps base.datestamp with
did.fun.timestamp(). The private _utc_timestamp it replaces had a looser
clamp (':60.123' -> ':59.999123'), so it is removed.
sqlitedb (decd155, da83fa3): 30 s busy timeout on open; do_run_sql_query
retries BUSY/READONLY with MATLAB's backoff schedule, reopening the
connection first for READONLY (poisoned handle / DBMOVED); exhausted
retries print the filesystem diagnostics. Because SQLiteDB groups writes
into transactions where mksqlite autocommits, the statement retry runs
only with no transaction open, and COMMIT is retried (never reopened)
through a new _commit(). Deviations are recorded in the bridge entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Dn4gCNCU2jUGdmfPVCAGK
…db's public statics _strip_comment and _outside_brackets treated every unquoted ' as a string opener unless the previous *output* character was an identifier. After a closing bracket that character had already been blanked to a space, so `reshape(varargin,[],numRows)'; catch, end` in sqlitedb.m's run_sql_noOpen opened a string, the `end` went uncounted, and every method after it in the block was attributed to nothing. That included the whole `methods (Static, Access=public)` block, so the "missing" check never saw its eight public methods. close_db was masked as well, but did.database defines one, so its entry still resolved. A quote is now a transpose when the source character before it is an identifier character, a closing bracket, '.', or another quote. With the parser fixed, the eight methods need entries: dispatchCustomFileHandler, isSafeUid, isRemoteLocation and isWithin map to existing private helpers. handlerTakesContext, filesAreIdentical, containsTraversal and isAbsolutePath are inlined or replaced in Python; their entries say where and how. Writing them turned up one real divergence, recorded on handlerTakesContext and not fixed here: Python offers a series-member fetch to a two-argument handler, where MATLAB never asks one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Dn4gCNCU2jUGdmfPVCAGK
#91's bridge coverage job reports the same three drift problems #90 fixes. Merging that branch here makes this PR's check meaningful now; the merge is a no-op once #90 lands on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Dn4gCNCU2jUGdmfPVCAGK
Contributor
Author
|
The first run's "Bridge coverage vs DID-matlab" failure wasn't caused by this PR. It was the 3 drift problems ( Generated by Claude Code |
This was referenced Oct 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #90.
The checker bug
_strip_commentand_outside_bracketsinbin/check_bridge_coverage.pytreated an unquoted'as the start of a string unless the previous output character was an identifier. After a closing bracket, that output character has already been blanked to a space. So insqlitedb.m'srun_sql_noOpen, the transpose inwas read as opening a string, and the
endwent uncounted. Every method after that line in the block was attributed to nothing, including the wholemethods (Static, Access=public)block, so themissingcheck never saw its 8 public methods.close_dbwas hidden too, but its entry still resolved becausedid.databasealso defines one.Fix: a
'is now a transpose when the source character before it is an identifier character, a closing bracket,.or another'. Regression tests are intests/test_bridge_contract.py. They fail without the fix and pass with it.The 8 entries the fix exposes
dispatchCustomFileHandler_dispatch_custom_file_handlerinspect.signaturewhere MATLAB usesnarginhandlerTakesContext~(inlined)filesAreIdentical~(inlined in_open_series_member)isSafeUid_is_safe_uiddid.file.is_safe_uid, not a delegate, despite what its docstring sayscontainsTraversal~_is_withinisAbsolutePath~os.path.isabsisRemoteLocation_is_remote_locationstrtrimon the typeisWithin_is_withincommonpathvs. a prefix matchDivergence found, recorded but not fixed here. MATLAB's
fetchSeriesMemberBytesnever asks a two-argumentcustomFileHandlerfor a series member, because such a handler only sees the manifest's location. Python's_open_series_memberhas no such gate. It asks any handler, and catches a re-fetched manifest afterwards with the same-bytes check. A two-argument handler that returns some other file is accepted in Python, where MATLAB would never have called it. Changing that is a behaviour port, so it belongs in its own PR.CI
#90 has merged. The branch's merge of #90 is now a no-op, and against
mainthis PR changes onlybin/check_bridge_coverage.py, the implementations bridge YAML andtests/test_bridge_contract.py. All checks pass, including "Bridge coverage vs DID-matlab" with 0 problems.Generated by Claude Code