HERMES-GIELIE/api
b3nw e8f7e28a3c fix: address gate cert BRICKs + Greptile P1 on PR #5688
Address the RED gate cert on PR #5688 (2 BRICK + 1 CORE) and the
incoming Greptile review (1 P1 + 3 P2):

- BRICK-1 (race-safety): drop the mtime heuristic and any age-based
  lock removal. Add /api/updates/clear_lock with a fail-closed
  fcntl.flock holder probe (refuses if any process still holds the
  file, on POSIX). On non-POSIX, fails closed. Touches only
  .git/index.lock (the only well-known short-lived lock git creates).
- BRICK-2 (destructive path coupling): remove lock_conflict from the
  force-button condition. Add a separate btnClearUpdateLock that calls
  /api/updates/clear_lock -- never apply_force_update. The recovery
  path never runs checkout/clean/reset --hard.
- CORE-1 (unconditional pre-cleanup): apply_force_update no longer
  iterates .git/**/*.lock. Lock cleanup is exclusively the clear_lock
  endpoint's job.
- Greptile P1: when a pull-lock error fires after a stash was pushed,
  run git stash pop (with apply+drop fallback) so the user's local
  modifications aren't stranded in the stash silently. v2 tests
  cover the stashed and the clean cases.
- Greptile P2 (broad 'lock file' substring): tightened _GIT_LOCK_SIGNATURES
  to specific git error strings ('index.lock': file exists, '.lock':
  file exists, 'another git process seems to be running',
  'unable to create .git/index.lock') so unrelated ref-transaction
  lock-loss messages no longer trigger a lock-conflict response.
- Greptile P2 (redundant git_dir.exists / magic number): both gone as a
  side effect of removing the apply_force_update cleanup loop entirely.

Refactor: rebased onto current upstream/master so PR is no longer
'behind' 130 commits.

Tests:
- 14 new v2 tests covering holder probe (true/false/NOGIL probe),
  _try_remove_lock (refuse-on-held/success-on-unheld),
  apply_clear_lock (success/refused), signature set parameter table
  including false-positive class, apply_force_update no-touch
  contract, pull-lock stash restore, pull-lock no-stash-when-clean.
- 2 v1 tests removed (they encoded the unsafe behavior).
- 2 v1 parametrize rows dropped (their positive cases relied on the
  broad 'lock file' substring).

Closes #5687
2026-07-06 17:37:05 +00:00
..
__init__.py
agent_health.py fix(health): send Bearer auth on remote /health/detailed probe (#5418) 2026-07-02 16:24:39 +00:00
agent_sessions.py fix(#5587): keep active CLI sessions visible before final output 2026-07-05 01:25:50 +00:00
auth.py fix(#5578): stop login next= param from nesting into itself and exploding the URL 2026-07-05 00:12:19 +00:00
auth_oidc.py fix(#3825): harden oidc endpoint and claim validation 2026-06-30 20:59:19 -04:00
background.py
background_process.py fix(webui): render a server-initiated turn that finished during an SSE gap on a visible tab 2026-06-30 17:13:45 +00:00
clarify.py
commands.py fix(webui): guard non-dict resolve_moa_preset result in resolve_moa_config 2026-07-01 07:54:48 -05:00
compression_anchor.py Address compaction marker and redaction review 2026-06-26 00:12:09 +00:00
compression_recovery.py Live Stream: add compression recovery action 2026-07-04 21:42:32 +08:00
config.py fix(#5619): preserve same-path cfg overrides on reload 2026-07-05 17:08:20 -04:00
crash_visibility.py fix(webui): crash visibility — faulthandler + thread excepthook + exit audit (#4633) 2026-07-01 18:01:39 +00:00
dashboard_probe.py
extensions.py fix: prefer IPv4 for extension gallery downloads to prevent timeout on broken IPv6 2026-07-03 20:26:18 +00:00
gateway_chat.py fix(#5564): mint stable per-message ids so large-session forks align 2026-07-04 22:46:56 +00:00
gateway_restart.py fix(health): preserve restart failure contract and proofs (#5156) 2026-06-29 03:44:06 +00:00
gateway_watcher.py
goals.py
helpers.py fix(redaction): memoize deterministic API response redactor 2026-06-29 18:22:18 +00:00
kanban_bridge.py
metering.py
models.py Merge latest master into compression recovery action 2026-07-05 17:23:05 +08:00
oauth.py
office_documents.py #5142: office-doc preview + safe docx editing (#540), rebased on master; optional deps 2026-07-02 01:15:57 +00:00
onboarding.py feat(#3260): self-hosted provider setup (Ollama/LM Studio) in Settings (i18n complete) 2026-07-02 08:17:44 +00:00
passkeys.py
paths.py
plugin_providers.py
plugins.py
profiles.py fix(#5567): pin worker profile via hermes-agent v0.18.0 context-local HERMES_HOME override 2026-07-04 23:40:10 +00:00
providers.py feat(#3260): self-hosted provider setup (Ollama/LM Studio) in Settings (i18n complete) 2026-07-02 08:17:44 +00:00
request_diagnostics.py fix(#4973): replace per-request diagnostics Timer with a process-global watchdog thread 2026-06-26 07:58:13 +00:00
rollback.py
route_approvals.py fix(#5000): relay mirrored gateway approvals after stream loss 2026-06-27 06:03:24 +00:00
route_session_list_cache.py feat: add Webhooks sidebar filter parity 2026-06-30 17:06:31 +00:00
routes.py fix: address gate cert BRICKs + Greptile P1 on PR #5688 2026-07-06 17:37:05 +00:00
run_journal.py
runner_client.py
runtime_adapter.py
session_discoverability.py
session_events.py
session_export_html.py #4968: export chat to self-contained themed HTML, rebased on master 2026-07-02 02:36:09 +00:00
session_lifecycle.py fix(#5543): fire-and-forget commit_session_memory + drain-safe managed stop 2026-07-04 21:40:21 +00:00
session_ops.py fix(#5563): align forked context to display for large (compacted) sessions 2026-07-04 20:55:06 +00:00
session_recovery.py Merge latest master into compression recovery action 2026-07-05 10:23:15 +08:00
skill_usage.py
sse_chunked.py
startup.py
state_sync.py
streaming.py fix(streaming): guard empty terminal error hints 2026-07-06 11:15:31 +08:00
system_health.py fix: keep psutil optional for system health 2026-06-26 20:49:13 +00:00
terminal.py
todo_state.py
turn_journal.py
updates.py fix: address gate cert BRICKs + Greptile P1 on PR #5688 2026-07-06 17:37:05 +00:00
upload.py fix(auth): enforce active-profile session IDs 2026-06-30 04:28:15 +00:00
usage.py
webui_session_db.py fix: preserve compression recovery child markers in sidecar rebuild 2026-07-05 06:45:50 +08:00
workspace.py #5142: office-doc preview + safe docx editing (#540), rebased on master; optional deps 2026-07-02 01:15:57 +00:00
workspace_git.py
worktrees.py