Compare commits
1 Commits
main
..
5addcde1e2
| Author | SHA1 | Date | |
|---|---|---|---|
| 5addcde1e2 |
@@ -111,8 +111,7 @@ jobs:
|
||||
done
|
||||
test "$parser_install_succeeded" = true
|
||||
PIP_CACHE_DIR="$parser_pip_cache" python3 /tmp/pip.pyz install --upgrade --target .python-ci pytest==8.3.5 httpx2==2.12.0
|
||||
python3 --version
|
||||
PYTHONFAULTHANDLER=1 PYTHONPATH="$PWD/.python-ci" AI_SERVICE_SKIP_MODEL_LOAD=1 python3 -m pytest -q
|
||||
PYTHONPATH="$PWD/.python-ci" AI_SERVICE_SKIP_MODEL_LOAD=1 python3 -m pytest -q
|
||||
|
||||
- name: Restore backend
|
||||
# The runner/proxy has occasionally supplied checksum-invalid NuGet cache entries (NU3008).
|
||||
@@ -313,16 +312,9 @@ jobs:
|
||||
# checksum-valid npm download (`true` became `tr<garbage>e`, or a stray `break` appeared).
|
||||
# Retry only that unmistakable source-corruption signature from a new isolated cache.
|
||||
# Ordinary Axe violations and application assertions remain terminal.
|
||||
if { grep -q "AxeBuilder.analyze" "$smoke_log" \
|
||||
&& grep -Eq "page\.evaluate: (ReferenceError|SyntaxError)" "$smoke_log"; } \
|
||||
|| { grep -Eq 'node_modules/playwright-core/lib/utilsBundle\.js:[0-9]+' "$smoke_log" \
|
||||
&& grep -Fq 'const { items }$= this;' "$smoke_log" \
|
||||
&& grep -Fq 'SyntaxError: Missing initializer in destructuring declaration' "$smoke_log"; }; then
|
||||
echo "Browser runtime source appears corrupted — reinstalling the locked dependencies from a fresh cache and retrying the complete suite once..."
|
||||
mkdir -p .artifacts/browser-runtime-attempt-1
|
||||
cp "$smoke_log" .artifacts/browser-runtime-attempt-1/smoke.log
|
||||
if [ -d test-results ]; then cp -a test-results .artifacts/browser-runtime-attempt-1/; fi
|
||||
if [ -f .artifacts/playwright-results.json ]; then cp .artifacts/playwright-results.json .artifacts/browser-runtime-attempt-1/; fi
|
||||
if grep -q "AxeBuilder.analyze" "$smoke_log" \
|
||||
&& grep -Eq "page\.evaluate: (ReferenceError|SyntaxError)" "$smoke_log"; then
|
||||
echo "Axe runtime source appears corrupted — reinstalling the locked dependencies from a fresh cache and retrying the complete suite once..."
|
||||
rm -rf node_modules
|
||||
npm_cache="$(mktemp -d)"
|
||||
npm ci --no-audit --no-fund --cache "$npm_cache"
|
||||
@@ -344,7 +336,6 @@ jobs:
|
||||
name: browser-diagnostics
|
||||
path: |
|
||||
job-tracker-ui/.artifacts/playwright-results.json
|
||||
job-tracker-ui/.artifacts/browser-runtime-attempt-1/
|
||||
job-tracker-ui/test-results
|
||||
retention-days: 7
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
using System.Security.Claims;
|
||||
using JobTrackerApi.Controllers;
|
||||
using JobTrackerApi.Data;
|
||||
using JobTrackerApi.Models;
|
||||
using JobTrackerApi.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class CompanyCreateCompatibilityTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Exact_Norwegian_name_reuses_owned_company_without_overwriting_existing_fields()
|
||||
{
|
||||
await using var fixture = await Fixture.CreateAsync();
|
||||
var existing = new Company { OwnerUserId = "owner-a", Name = "Ærlig Økonomi Ås", Location = "Original location", Source = "Finn", RecruiterEmail = "retained@example.test" };
|
||||
fixture.Db.Companies.Add(existing);
|
||||
await fixture.Db.SaveChangesAsync();
|
||||
|
||||
var result = await fixture.Controller.Create(new(" Ærlig Økonomi Ås ", "Imported location", "LinkedIn"), default);
|
||||
|
||||
var company = Assert.IsType<Company>(Assert.IsType<OkObjectResult>(result.Result).Value);
|
||||
Assert.Equal(existing.Id, company.Id);
|
||||
Assert.Equal("owner-a", company.OwnerUserId);
|
||||
Assert.Equal("Ærlig Økonomi Ås", company.Name);
|
||||
Assert.Equal("Original location", company.Location);
|
||||
Assert.Equal("Finn", company.Source);
|
||||
Assert.Equal("retained@example.test", company.RecruiterEmail);
|
||||
Assert.Equal(1, await fixture.Db.Companies.IgnoreQueryFilters().CountAsync());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Ascii_case_insensitive_reuse_and_trimmed_input_remain_compatible()
|
||||
{
|
||||
await using var fixture = await Fixture.CreateAsync();
|
||||
var existing = new Company { OwnerUserId = "owner-a", Name = "Northwind AS", Location = "Original location", Source = "Finn" };
|
||||
fixture.Db.Companies.Add(existing);
|
||||
await fixture.Db.SaveChangesAsync();
|
||||
|
||||
var result = await fixture.Controller.Create(new(" nORTHWIND aS ", "Another location", "LinkedIn"), default);
|
||||
|
||||
var company = Assert.IsType<Company>(Assert.IsType<OkObjectResult>(result.Result).Value);
|
||||
Assert.Equal(existing.Id, company.Id);
|
||||
Assert.Equal("Northwind AS", company.Name);
|
||||
Assert.Equal("Original location", company.Location);
|
||||
Assert.Equal("Finn", company.Source);
|
||||
Assert.Equal(1, await fixture.Db.Companies.CountAsync());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task An_identical_foreign_name_creates_a_separate_owned_company_and_preserves_source_normalization()
|
||||
{
|
||||
await using var fixture = await Fixture.CreateAsync();
|
||||
var foreign = new Company { OwnerUserId = "owner-b", Name = "Ærlig AS", Location = "Private location", Source = "Private source", RecruiterEmail = "private@example.test" };
|
||||
fixture.Db.Companies.Add(foreign);
|
||||
await fixture.Db.SaveChangesAsync();
|
||||
|
||||
var result = await fixture.Controller.Create(new(" Ærlig AS ", " Bergen ", "https://www.nav.no/jobs"), default);
|
||||
|
||||
var company = Assert.IsType<Company>(Assert.IsType<CreatedAtActionResult>(result.Result).Value);
|
||||
Assert.NotEqual(foreign.Id, company.Id);
|
||||
Assert.Equal("owner-a", company.OwnerUserId);
|
||||
Assert.Equal("Ærlig AS", company.Name);
|
||||
Assert.Equal("Bergen", company.Location);
|
||||
Assert.Equal("NAV", company.Source);
|
||||
Assert.Null(company.RecruiterEmail);
|
||||
Assert.Equal(1, await fixture.Db.Companies.CountAsync());
|
||||
Assert.Equal(2, await fixture.Db.Companies.IgnoreQueryFilters().CountAsync());
|
||||
var retained = await fixture.Db.Companies.IgnoreQueryFilters().AsNoTracking().SingleAsync(value => value.Id == foreign.Id);
|
||||
Assert.Equal("owner-b", retained.OwnerUserId);
|
||||
Assert.Equal("Private location", retained.Location);
|
||||
Assert.Equal("Private source", retained.Source);
|
||||
Assert.Equal("private@example.test", retained.RecruiterEmail);
|
||||
}
|
||||
|
||||
private sealed class Fixture(SqliteConnection connection, JobTrackerContext db) : IAsyncDisposable
|
||||
{
|
||||
public JobTrackerContext Db { get; } = db;
|
||||
public CompaniesController Controller { get; } = new(db)
|
||||
{
|
||||
ControllerContext = new ControllerContext
|
||||
{
|
||||
HttpContext = new DefaultHttpContext
|
||||
{
|
||||
User = new ClaimsPrincipal(new ClaimsIdentity([new Claim(ClaimTypes.NameIdentifier, "owner-a")], "test")),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
public static async Task<Fixture> CreateAsync()
|
||||
{
|
||||
var connection = new SqliteConnection("Data Source=:memory:");
|
||||
await connection.OpenAsync();
|
||||
var currentUser = new Mock<ICurrentUserService>();
|
||||
currentUser.SetupGet(value => value.UserId).Returns("owner-a");
|
||||
var db = new JobTrackerContext(new DbContextOptionsBuilder<JobTrackerContext>().UseSqlite(connection).Options, currentUser.Object);
|
||||
await db.Database.EnsureCreatedAsync();
|
||||
return new Fixture(connection, db);
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await Db.DisposeAsync();
|
||||
await connection.DisposeAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ namespace JobTrackerApi.Controllers
|
||||
existingQuery = existingQuery.Where(c => c.OwnerUserId == userId);
|
||||
|
||||
var existing = await existingQuery
|
||||
.FirstOrDefaultAsync(c => c.Name.ToLower() == name.ToLower(), cancellationToken);
|
||||
.FirstOrDefaultAsync(c => c.Name == name || c.Name.ToLower() == name.ToLower(), cancellationToken);
|
||||
|
||||
if (existing is not null)
|
||||
{
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# Shared browser authentication fixture — 20 October 2026
|
||||
|
||||
The instrumented Linux suite returned HTTP 429 from fixture logins in Companies, correspondence and preservation journeys. The general browser fixture configured 100 authentication permits per five-minute window. Every test and retry shares the same loopback address and backend process; the server partitions that limiter by remote IP. Fast fixture failures and repeated identity setup can exhaust this shared allowance before the window renews. A rejected fixture login prevents the workflow from running; it is not an application assertion failure.
|
||||
|
||||
The general isolated browser fixture now allows 1,000 login permits per window. This is test-only environment configuration; the application default remains ten. The separate `playwright.rate-limits.config.ts` explicitly retains ten permits and zero retries for real middleware/rate-limit contracts. No production config, auth implementation, login assertion, permission requirement or dedicated throttle expectation is changed. The allowance supplies headroom for the current 331-case full suite, repeated identities and its existing one retry.
|
||||
|
||||
The dedicated real-HTTP throttle suite passed all nine cases at 07:34:38–07:34:50 UTC, zero skips/retries/flaky outcomes, with its unchanged ten-permit configuration. Browser TypeScript and lint pass. The subsequent full Linux run must prove the shared-fixture correction; focused workflow passes alone cannot prove cumulative capacity. The original 429 traces remain evidence. This correction does not establish deployment or Phase 7 acceptance.
|
||||
@@ -1,9 +0,0 @@
|
||||
# Browser fixture portability and confirmation focus contracts
|
||||
|
||||
Run832 at main `d1fcd2308755dfc112a2bd6a736dd763bbc895f9` completed its331-case browser suite:314 passed,16 failed, one flaky Rules draft case. Deployment was skipped. The Playwright runtime-corruption signature did not recur in this completed run. These outcomes do not establish production readiness or resolve the existing intermittent Rules observation.
|
||||
|
||||
Eleven failures came from `seed-operation.py` calling Python3.12's `Path.is_junction` on the Debian runner's Python3.11.2 PosixPath. This was independently reproduced by running the unchanged helper in an isolated, network-disabled `node:20-bookworm` container on the runner host; host Python3.12.3 passed. Junction checks now execute only on Windows, where the existing Python3.12 guard is preserved. Absolute/direct-temp-root, symlink, hardlink, exact owner/schema and insert-only SQL protections remain unchanged. All29 self-checks pass both on local Windows and in that same Python3.11 container after the correction. No existing application data or production container is mounted into the test container.
|
||||
|
||||
Five failures were stale keyboard expectations after the verified shared confirmation scroll-body accessibility correction. The focusable named body now belongs in the native tab cycle. The tests explicitly verify Cancel → reverse Tab to named body → reverse Tab to Confirm → forward Tab to body → forward Tab to Cancel, followed by the original cancellation/focus/draft/action proofs. No focus assertion, axe rule, timeout or application behavior is relaxed. All five affected native cases pass with zero skips/flaky/retries,20October18:03:21–18:04:21UTC.
|
||||
|
||||
The bounded repair changes only the offline fixture and those two browser test consumers. Full release CI and deployed identity still require a new successful run. Production readiness remains NO-GO independently of the owner's authorization to publish main. The Qwen3.5 adapter preparation is separately tested; model activation and P5-13 qualification remain separate.
|
||||
@@ -1,9 +0,0 @@
|
||||
# Browser fixture portability — 20 October 2026
|
||||
|
||||
The instrumented Linux release run on `32bc65c` exposed `spawnSync rtk ENOENT` in the Career Profile import-review and Notifications fixtures. Operations used the same invocation. RTK is a developer command wrapper, not an application or CI dependency. The runner has `python3`; Windows uses `python`.
|
||||
|
||||
The three fixtures now invoke the configured `PLAYWRIGHT_PYTHON_PATH` directly, otherwise the platform's Python executable. The fixture arguments, isolated SQLite paths, owner checks, insert-only authorizer and assertions remain unchanged. No production data or application code is changed.
|
||||
|
||||
All 17 affected native browser cases passed locally without retries, skips or flaky outcomes at 07:19:59–07:22:20 UTC. Browser TypeScript and lint passed. This is focused Windows evidence; the subsequent full Linux release run must establish runner compatibility. The failing Linux traces remain preserved under the original diagnostic run. There is no change to browser inventory or the existing release gates.
|
||||
|
||||
The independent dialog accessibility and fixture-login rate-limit findings remain under investigation. This repair alone does not establish deployment success or Phase 7 acceptance.
|
||||
@@ -1,13 +0,0 @@
|
||||
# Confirmation transition must preserve deliberate focus
|
||||
|
||||
Release833 at main `f7dc22e5e7efe1fd1d64f6ace2c04cf2f95bf558` exposes a distinct confirmation failure after the earlier complete tab-cycle test correction: Cancel initially receives focus and reverse traversal succeeds, but the later opening-transition callback can reset focus while forward keyboard traversal is already under way. This is a user-visible shared-owner race, not permission to relax the tab sequence or increase its timeout.
|
||||
|
||||
A deterministic new component regression focuses the named scroll body before advancing the opening transition. Existing code fails with focus moved back to Cancel:2existing cases pass/1new case fails (`p712-confirm-transition-red-20261020T184351Z`). Removing the redundant `onEntered` forced focus and its button ref leaves the existing Cancel `autoFocus` and MUI focus trap/restoration in place. All3component cases then pass (`p712-confirm-transition-green-20261020T184416Z`). No confirmation resolution, destructive guard, data write or dialog body accessibility changes.
|
||||
|
||||
All5affected native journeys pass after this repair on20October18:44–18:46UTC, with zero skips/flaky/retries. They retain explicit Cancel → reverse Tab body → reverse Tab Confirm → forward Tab body → forward Tab Cancel, the original cancellation/focus/draft assertions, and Discovery create/delete persistence. App/browser TypeScript, lint and production build pass. Full integrated successor validation follows; Linux CI/deployed acceptance is not inferred from Windows.
|
||||
|
||||
The interrupted P7-12 whole-browser attempt also exposed two stale English-only `Technical` template selectors after the approved Bokmål gallery localisation. That separate development test consumer now uses the existing locale key without changing template entitlement or any assertion. Original failing evidence is retained and the fresh successor run must use the repaired committed source.
|
||||
|
||||
Release833 also records Chromium page crashes in the CV-controls and administrator route census. An18:39UTC runner observation reports no cgroup OOM events, no container memory limit,1GiB shared memory and no kernel errors in the queried interval. This observation neither explains the crashes nor proves hardware health. Keep this infrastructure/reliability qualification separate from the deterministically reproduced focus race.
|
||||
|
||||
Production readiness remains NO-GO independently of the owner's release authorization. No model activation or P5-13 qualification is part of this repair.
|
||||
@@ -1,9 +0,0 @@
|
||||
# Confirmation keyboard scrolling — 20 October 2026
|
||||
|
||||
The Linux compose journey found a serious `scrollable-region-focusable` violation in the shared confirmation dialog at a short landscape viewport. Its message body can overflow independently while containing no focusable content. The shared owner is `ConfirmProvider`, also used by attachment deletion, application workspace changes, CV template changes and Career evidence deletion.
|
||||
|
||||
The body now exposes a keyboard-focusable region named by the existing localized dialog title. Cancel retains initial focus; confirmation, dismissal, focus restoration and Promise resolution are unchanged. No new strings, dialog framework or saving semantics are introduced.
|
||||
|
||||
The strengthened existing unit case failed ordinarily before the implementation (one failure, one pass). Afterward all eight cases in the confirmation, confirmation-flow, dialog-flow and modal-state suites passed. The full ten-case native compose suite passed without retries/skips/flaky outcomes at 07:28:17–07:29:43 UTC against a fresh production export. This includes the eight-width bilingual theme/keyboard journey and its unchanged all-enabled axe assertion. Build passed. No test inventory change, accessibility waiver or production authorization change is made.
|
||||
|
||||
Human screen-reader and physical-device acceptance remain pending. This narrow correction does not accept the remaining Phase 7 migration or establish live deployment success.
|
||||
@@ -1,9 +0,0 @@
|
||||
# Notification caption fixture — 20 October 2026
|
||||
|
||||
The full Linux diagnostic found four ordinary shell failures, each repeated by the existing CI retry: the loose `getByText(t.notificationsUnread)` query matched both the visible localized Unread caption and the shell's unread-count live announcement. Both are intentional accessibility/UI content. The fixture intended to assert the exact caption.
|
||||
|
||||
The locator now uses `{ exact: true }`. It still requires the visible translated caption, retains the live status announcement and preserves every notification mark-read/dismiss assertion and axe scan. No product behavior changes. Browser inventory stays 331.
|
||||
|
||||
All 20 existing shell-readiness cases pass without skips/flaky/retries at 07:42:01–07:44:53 UTC, across English/Bokmål and light/dark, with browser TypeScript passing. Whitespace checks pass. Full Linux acceptance remains required for the new main candidate; this focused result is not deployment success.
|
||||
|
||||
Run 828 completed its 331-case browser lane with 274 passing and 57 failing cases. All failed cases are accounted for by the five investigated causes: 35 shared-login 429, 15 Python-wrapper absence, four caption locator collisions, two stale route expectations and one keyboard-scroll axe violation. Original retries and failure artifacts remain retained. Subsequent corrected-run results must determine whether these repairs are sufficient.
|
||||
@@ -1,9 +0,0 @@
|
||||
# Playwright runtime corruption signature — 20 October 2026
|
||||
|
||||
Corrected release run831 did not reach deployment. Its browser lane encountered Chromium target crashes and an installed Playwright parser failure at `node_modules/playwright-core/lib/utilsBundle.js:35841`: `const { items }$= this;`, followed by `SyntaxError: Missing initializer in destructuring declaration`. A worker then exited before executing its cases. Only46 browser attempts appear in the terminal log; this is not a completed331-case regression. An ordinary preview-visibility assertion also failed and is retained, rather than labelled an infrastructure success.
|
||||
|
||||
This resembles earlier runner dependency/download corruption, but the job container was removed before its installed bytes could be compared with the lockfile archive. Neither persistent filesystem corruption nor faulty hardware is proven. The full900-entry diagnostic ZIP was downloaded and CRC-checked: SHA256 `f6d8e9659ca824bb12d283913f6e16f3933974bbc5e11c78e3524d8712e75632`. Original logs and traces remain retained.
|
||||
|
||||
The workflow already allows one complete-suite retry after its narrowly recognized Axe source-corruption signature, using a new npm cache and the unchanged lockfile. Extend that same bounded policy only when all three observed Playwright indicators occur together: the exact dependency path/line marker, the exact malformed statement and the exact parser error. Ordinary application assertion failures, target crashes alone, user-source syntax errors and incomplete signatures remain terminal. The six policy tests execute the actual Bash guard and pass. No assertion, browser inventory, timeout, ordinary retry, dependency integrity or release gate is relaxed.
|
||||
|
||||
Before the existing reinstall/retry, preserve the first smoke log, JSON report if available and complete traces/screenshots under `.artifacts/browser-runtime-attempt-1`; include them in the same always-uploaded artifact. A subsequent successful retry must still complete the entire browser suite; failure remains blocking. This does not repair or qualify the underlying runner, prove the preview assertion resolved or establish deployment success. Production/operator, physical hardware/runtime and manual application qualifications remain open. P5-13 and model activation are unchanged.
|
||||
@@ -1,9 +0,0 @@
|
||||
# Qwen3.5 compatibility preparation
|
||||
|
||||
The owner requested `qwen3.5:9b-q4_K_M` after live deployment. The model is downloaded, but the active sidecar still uses the previous model. This change prepares the existing adapter; it does not activate a model or qualify the withheld P5-13 capability.
|
||||
|
||||
The existing adapter consumes Ollama's final `response`. A synthetic local probe found an empty response with the Qwen3.5 thinking default; a20October probe with `think:false` returned the requested synthetic JSON and no thinking text. The adapter now sets that request field only when the configured base family is exactly `qwen3.5`. Existing temperature, JSON mode, timeouts, response parsing, other model payloads and external-provider consent/fallback remain unchanged. Custom namespace aliases are outside this exact family match.
|
||||
|
||||
Seven new offline cases verify both text/JSON for the requested tag and bare family, and unchanged payloads for qwen2.5, qwen3 and a lookalike family. Four Qwen3.5 cases failed ordinarily before the two-line change; three compatibility cases passed. The full sidecar suite then passed **56/56**, zero failures/errors/skips,8.45seconds,20October13:32UTC. The prior49-case baseline grows by seven; no model calls are part of these tests. Raw RED/GREEN logs and JUnit are retained under `.artifacts/release-20261020/model-compat/`.
|
||||
|
||||
Live activation, deployed adapter identity, GPU residency and final-response smoke remain pending behind the release. P5-13's deployed-identity/366-call/independent-human-review/UI requirements remain unmet and its review feature stays disabled. Production readiness remains NO-GO independently of the owner's release authorization.
|
||||
@@ -1,11 +0,0 @@
|
||||
# Bounded follow-redirects security patch
|
||||
|
||||
The21October fresh npm audit identifies production-classified transitive `follow-redirects`1.16.0 with high-severity [array-header credential stripping](https://github.com/advisories/GHSA-q3jh-wrc6-jgq8) and [custom sensitive-header escaping](https://github.com/advisories/GHSA-8r9p-f939-6h3c) advisories. Both advisory records identify1.16.1as patched. This is a dependency finding, not evidence that Jobjakt was exploited or that its browser adapter exercises either vector.
|
||||
|
||||
`npm update follow-redirects --ignore-scripts --no-audit --no-fund` changes exactly one package. The only tracked dependency diff is that lock entry's version, tarball URL and integrity:1.16.0→1.16.1. Existing package ranges, Axios, frameworks, other dependencies, audit policy and the owner's temporary dev-only braces exception remain unchanged. No override or new dependency is introduced.
|
||||
|
||||
Fresh production audit reports0vulnerabilities. The full audit policy passes with only the previously approved dev-only braces-derived high chain accepted through31October; moderate development findings remain recorded. No additional exception is added. Two synthetic loopback contracts verify array-form Authorization/Cookie/Proxy-Authorization stripping and custom credential names containing`^`/`|`, while retaining a public header. Both pass against the installed1.16.1; no real credentials or external target is involved.
|
||||
|
||||
Raw pre/post audit records are `.artifacts/phase7/current/p712-final-security/` and `.artifacts/phase7/current/p712-follow-redirects/`. The bounded helper is `.artifacts/phase7/current/p712-redirect-contract.cjs`. Production build and application/browser TypeScript/lint are rerun; final whole-application/browser proof uses the patched dependency set. The active pre-patch browser candidate is interrupted and retained rather than presented as validating the new lock.
|
||||
|
||||
This patch does not resolve the independent runner's Python/.NET native crashes, qualify deployed identity, activate Qwen3.5or complete P5-13. Production readiness remains NO-GO independently of the owner's release authorization. No Phase8 implementation.
|
||||
@@ -1,50 +0,0 @@
|
||||
# Parser CI native exit investigation, 2026-10-21
|
||||
|
||||
## Verified evidence
|
||||
|
||||
CI run 834, API test job 1721, failed in `Test document parser boundary`.
|
||||
The fetched log is `.artifacts/phase7/p7-09/instrumented-release-ci/20261021T050601Z/failed-job-logs.log`;
|
||||
the adjacent `api-observation.json` records the GET of job 1721's logs.
|
||||
The runner's internal task ID 1689 is separate from the API job ID.
|
||||
|
||||
At 2026-10-20 20:36:38 UTC, pytest reported `56 passed, 1 warning in 5.36s`.
|
||||
The shell subsequently reported a segmentation fault and exit 139. Passing assertions
|
||||
did not constitute successful process completion. Later browser steps did not run;
|
||||
deployment remained blocked.
|
||||
|
||||
Read-only host inspection with
|
||||
`coredumpctl --no-pager info 3804681` confirmed:
|
||||
|
||||
- Signal: 11 (SIGSEGV).
|
||||
- Command: `python3 -m pytest -q`.
|
||||
- Executable: `/usr/bin/python3.11`.
|
||||
- Timestamp: 2026-10-20 22:36:38 CEST (20:36:38 UTC).
|
||||
- Docker scope: `040c0b99c92e0a5a48c00994e10a264884ca8172f5eac94d49e3d7aa1d92fd27`,
|
||||
matching the failed job's container.
|
||||
- Stored core: `/var/lib/systemd/coredump/core.python3.0.7aab2b376ce94d92bf796bbeb62063a4.3804681.1792528598000000.zst`.
|
||||
|
||||
The core was inaccessible to SSH user `pi`; `sudo -n` required a password.
|
||||
No native backtrace was obtained. Kernel journal error entries for
|
||||
20:30-20:40 UTC were empty; that does not establish host health.
|
||||
|
||||
## Interpretation and bounded diagnostic
|
||||
|
||||
The timing is consistent with interpreter shutdown or cleanup, but the root cause
|
||||
is unproven. `AI_SERVICE_SKIP_MODEL_LOAD=1` prevents model weight loading;
|
||||
`app.py` still imports Torch and Transformers. Native extension cleanup is therefore
|
||||
a candidate, not an identified cause. Previous download corruption and browser
|
||||
crashes do not prove the cause of this Python crash.
|
||||
|
||||
The workflow now prints the Python version and enables `PYTHONFAULTHANDLER=1`
|
||||
for the unchanged pytest command. It preserves the existing dependency installs,
|
||||
all tests, and process exit status, without adding retries or suppressing signals.
|
||||
The existing pip log already records installed distribution versions. In this run,
|
||||
the test-runtime install upgraded locked AnyIO 4.14.2 to 4.15.1 and IDNA 3.19 to
|
||||
3.20; this is a reproducibility observation, not a demonstrated cause, and no
|
||||
dependency change is included here.
|
||||
|
||||
Next evidence: inspect the retained core with authorized access, or capture the
|
||||
faulthandler output from a subsequent normal CI run before choosing a fix.
|
||||
The diagnostic change has only received workflow text and whitespace checks;
|
||||
it has not been exercised in CI. No production mutation, model qualification,
|
||||
or successful release is claimed.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Company-create compatibility prerequisite
|
||||
|
||||
The actual JSON export/import journey exposed a backend prerequisite: importing the exact existing Norwegian company name created a second company. SQLite's default `LOWER()` handles ASCII while the bound .NET lower-case parameter folds Norwegian letters. The previous comparison therefore missed an exact existing name containing `Æ`, `Ø` or `Å`. The original failing import trace and the candidate repair evidence remain under `.artifacts/phase7/p7-09/`; the importer does not work around the server by changing company names.
|
||||
|
||||
The bounded repair checks exact equality alongside the existing lower-case comparison inside the same owner-filtered query. Trimming, source normalization, 200-for-reuse/201-for-create, metadata retention and account ownership are preserved. It performs no schema migration, historical deduplication or destructive write. Broader Unicode case-folding equivalence and concurrent creation idempotency remain RD21 debt.
|
||||
|
||||
Three real SQLite regression cases prove exact Norwegian-name reuse without overwriting existing fields, retained ASCII case-insensitive reuse, and separate owned creation when an identical foreign company exists. The last case also verifies retained foreign metadata and source normalization. Fresh Release compilation and these three cases pass. A fresh unfiltered backend run passes **1,057/1,057**, zero skipped, at **20 October 2026 07:05:21–07:05:38 UTC**. The increase from 1,054 is exactly these three ordinary cases; existing cases were not removed or weakened.
|
||||
|
||||
The fresh native Companies suite passes **6/6**, zero retries/skipped/flaky, at **07:10:12–07:11:05 UTC**. It exercises the existing presentation and persisted owner behavior against the rebuilt API and current production frontend export. The [portable evidence](evidence/company-create-results.json) records commands, results and source/binary identities, explicitly identifying its post-run source observation. Earlier native import/company evidence is historical evidence, not substituted for these fresh results.
|
||||
|
||||
Preservation references are **PRES-J08, PRES-J10 and PRES-E09**. The complete matrix stays **56 PARTIAL / C11 DEFERRED**. Actual MariaDB/provider and production qualification, manual reader/device checks, the remaining import/data/privacy/plan/backup migration and RD21 concurrency work are not accepted here. P5-13 stays withheld, followMode stays deferred and Phase 8 is not implemented. This prerequisite is published separately from the active import UI work on the development branch; production readiness remains NO-GO despite the owner's separately authorized release repair.
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"checkpoint": "P7-09 company-create prerequisite",
|
||||
"observedUtc": "2026-10-20T07:15:05.299883+00:00",
|
||||
"baselineBackend": 1054,
|
||||
"newBackendCases": 3,
|
||||
"targeted": {
|
||||
"path": ".artifacts/phase7/current/backend-career/p709-company-compatibility-fresh-20261020T070423Z/command.json",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"C:/Users/Connor/.dotnet/dotnet.exe",
|
||||
"test",
|
||||
"JobTrackerApi.Tests/JobTrackerApi.Tests.csproj",
|
||||
"--configuration",
|
||||
"Release",
|
||||
"--no-restore",
|
||||
"--filter",
|
||||
"FullyQualifiedName~CompanyCreateCompatibilityTests",
|
||||
"--logger",
|
||||
"trx;LogFileName=career.trx",
|
||||
"--results-directory",
|
||||
"E:\\Storage\\Projects\\Active\\Job tracker\\.artifacts\\phase7\\current\\backend-career\\p709-company-compatibility-fresh-20261020T070423Z"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:04:23.391824+00:00",
|
||||
"finishedUtc": "2026-10-20T07:04:41.335549+00:00",
|
||||
"exitCode": 0,
|
||||
"logSha256": "f9fe87f762d872f11e2d6a7e14448e9f0451c2794b4094f5fe34eed1cd7cd6ad",
|
||||
"counts": {
|
||||
"total": 3,
|
||||
"passed": 3,
|
||||
"failed": 0,
|
||||
"notExecuted": 0
|
||||
},
|
||||
"resultSha256": "54e0867d3d80c438e9cdd026c1811ea8a52a7d8d9d057c847dac3a1593cf9fa9"
|
||||
},
|
||||
"fullBackend": {
|
||||
"path": ".artifacts/phase7/current/backend-career/p709-company-full-regression-20261020T070521Z/command.json",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"C:/Users/Connor/.dotnet/dotnet.exe",
|
||||
"test",
|
||||
"JobTrackerApi.Tests/JobTrackerApi.Tests.csproj",
|
||||
"--configuration",
|
||||
"Release",
|
||||
"--no-build",
|
||||
"--logger",
|
||||
"trx;LogFileName=career.trx",
|
||||
"--results-directory",
|
||||
"E:\\Storage\\Projects\\Active\\Job tracker\\.artifacts\\phase7\\current\\backend-career\\p709-company-full-regression-20261020T070521Z"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:05:21.416786+00:00",
|
||||
"finishedUtc": "2026-10-20T07:05:38.375404+00:00",
|
||||
"exitCode": 0,
|
||||
"logSha256": "fa6461b4e59d07bfa2ffe1d0a59daf7ab616a4e87b9dbb80f4548cee703a3537",
|
||||
"counts": {
|
||||
"total": 1057,
|
||||
"passed": 1057,
|
||||
"failed": 0,
|
||||
"notExecuted": 0
|
||||
},
|
||||
"resultSha256": "0c995ebf824d6a4b446af9878bdcfd53e72ee90759fead491d1bd1108be3b45e"
|
||||
},
|
||||
"native": {
|
||||
"path": ".artifacts/phase7/current/ui/companies.json",
|
||||
"command": {
|
||||
"name": "companies",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"node",
|
||||
"node_modules/@playwright/test/cli.js",
|
||||
"test",
|
||||
"e2e/phase7-companies.spec.ts",
|
||||
"--retries=0",
|
||||
"--reporter=list,json",
|
||||
"--output=E:\\Storage\\Projects\\Active\\Job tracker\\.artifacts\\phase7\\current\\ui\\companies-results"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:10:12.619786+00:00",
|
||||
"finishedUtc": "2026-10-20T07:11:05.493360+00:00",
|
||||
"exitCode": 0
|
||||
},
|
||||
"stats": {
|
||||
"startTime": "2026-10-20T07:10:13.244Z",
|
||||
"duration": 52203.75399999999,
|
||||
"expected": 6,
|
||||
"skipped": 0,
|
||||
"unexpected": 0,
|
||||
"flaky": 0
|
||||
}
|
||||
},
|
||||
"preservation": [
|
||||
"PRES-J08",
|
||||
"PRES-J10",
|
||||
"PRES-E09"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"path": "JobTrackerApi/Controllers/CompaniesController.cs",
|
||||
"sha256Raw": "a913bcd1e9993bc4f8fd88b5554b92eade263967c4027b2179244354ed96f7ec",
|
||||
"sha256Lf": "4db8eb5a0d434a346538003c426f9ace9fad55695b9a57c3a4bf441e5c0d37e3"
|
||||
},
|
||||
{
|
||||
"path": "JobTrackerApi.Tests/CompanyCreateCompatibilityTests.cs",
|
||||
"sha256Raw": "b15bbe1b256cae2a5712a954d2f84470d5a9acc1b734143d5879690486b5227c",
|
||||
"sha256Lf": "b15bbe1b256cae2a5712a954d2f84470d5a9acc1b734143d5879690486b5227c"
|
||||
}
|
||||
],
|
||||
"binaries": [
|
||||
{
|
||||
"path": "JobTrackerApi/bin/Release/net9.0/JobTrackerApi.dll",
|
||||
"sha256": "addbeef095ec5a69b9dc4646f790117d18faa24ab5cb7e36663e84f4fa3f9a66"
|
||||
},
|
||||
{
|
||||
"path": "JobTrackerApi.Tests/bin/Release/net9.0/JobTrackerApi.Tests.dll",
|
||||
"sha256": "12f4003d9e0a4f98598175a72d1bc7291c1f08fc166bd2b4e1b47f844c33b013"
|
||||
}
|
||||
],
|
||||
"qualification": "Source/binary identities observed after the fresh backend and Companies runs; earlier RED/native evidence remains separately retained. Not a pre-run capture or production/MariaDB acceptance."
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"checkpoint": "p7-09",
|
||||
"status": "PASS",
|
||||
"checkedUtc": "2026-10-20T07:15:55.632615+00:00",
|
||||
"commands": [
|
||||
{
|
||||
"name": "secret-scan",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"C:\\Users\\Connor\\AppData\\Local\\Programs\\Python\\Python312\\python.exe",
|
||||
"-X",
|
||||
"utf8",
|
||||
"scripts/supply-chain.py",
|
||||
"scan-secrets"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:15:51.896284+00:00",
|
||||
"finishedUtc": "2026-10-20T07:15:54.661570+00:00",
|
||||
"exitCode": 0,
|
||||
"log": ".artifacts/phase7/current/static/20261020T071551Z/secret-scan.log",
|
||||
"logSha256Raw": "be5119e6057287d397e87759f855c91e634e3bfac61c8be7584d05592ba2dfcd"
|
||||
},
|
||||
{
|
||||
"name": "working-whitespace",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"git",
|
||||
"diff",
|
||||
"--check"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:15:54.662586+00:00",
|
||||
"finishedUtc": "2026-10-20T07:15:54.772491+00:00",
|
||||
"exitCode": 0,
|
||||
"log": ".artifacts/phase7/current/static/20261020T071551Z/working-whitespace.log",
|
||||
"logSha256Raw": "7d4d21b7cfbda7f0adedeec159d5457b079dd3046eab064066ed668c6d1139cd"
|
||||
},
|
||||
{
|
||||
"name": "staged-whitespace",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"git",
|
||||
"diff",
|
||||
"--cached",
|
||||
"--check"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:15:54.772959+00:00",
|
||||
"finishedUtc": "2026-10-20T07:15:54.895580+00:00",
|
||||
"exitCode": 0,
|
||||
"log": ".artifacts/phase7/current/static/20261020T071551Z/staged-whitespace.log",
|
||||
"logSha256Raw": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
},
|
||||
{
|
||||
"name": "phase7-whitespace",
|
||||
"command": [
|
||||
"rtk",
|
||||
"proxy",
|
||||
"git",
|
||||
"diff",
|
||||
"--check",
|
||||
"b5319981ad3d1bd635daff861453d23c0de5320b"
|
||||
],
|
||||
"startedUtc": "2026-10-20T07:15:54.896077+00:00",
|
||||
"finishedUtc": "2026-10-20T07:15:55.135880+00:00",
|
||||
"exitCode": 0,
|
||||
"log": ".artifacts/phase7/current/static/20261020T071551Z/phase7-whitespace.log",
|
||||
"logSha256Raw": "c42dc788a516c9c9baadd44ae7a8c4c6d5b0e4cbff688f5b45647999e953e099"
|
||||
}
|
||||
],
|
||||
"untrackedSecretScan": {
|
||||
"files": 6,
|
||||
"findings": 0
|
||||
},
|
||||
"documentation": {
|
||||
"files": 29,
|
||||
"relativeLinks": 607,
|
||||
"errors": []
|
||||
},
|
||||
"preservation": {
|
||||
"groups": 57,
|
||||
"statuses": {
|
||||
"PARTIAL": 56,
|
||||
"PASS": 0,
|
||||
"FAIL": 0,
|
||||
"DEFERRED": 1
|
||||
},
|
||||
"originalRoutesPreserved": true,
|
||||
"currentConcreteRoutes": 33
|
||||
},
|
||||
"production": {
|
||||
"main": "f9bf31c9a9a9f40edefb855a0911d7f057fa4990",
|
||||
"originMain": "f9bf31c9a9a9f40edefb855a0911d7f057fa4990",
|
||||
"status": "NO-GO",
|
||||
"qualification": "Local fetched refs; direct push observation recorded separately."
|
||||
},
|
||||
"hashPolicy": "Portable JSON UTF8 LF; raw log hashes measure exact saved bytes.",
|
||||
"limits": [
|
||||
"Pattern scanner skips binary and files over2MiB; not historical Git/production secrets.",
|
||||
"Local links check target existence, not URL/heading anchors.",
|
||||
"Static evidence is not runtime/manual/device/provider/production acceptance."
|
||||
]
|
||||
}
|
||||
@@ -69,11 +69,11 @@ def seed_operation(payload: object) -> str:
|
||||
except OSError as error:
|
||||
raise SeedDenied("The isolated dataRoot must already exist") from error
|
||||
if (root != requested or root.parent != temporary or not root.is_dir()
|
||||
or requested.is_symlink() or (sys.platform == "win32" and requested.is_junction())
|
||||
or requested.is_symlink() or requested.is_junction()
|
||||
or not re.fullmatch(r"jobtracker-e2e-[A-Za-z0-9][A-Za-z0-9_-]*", root.name)):
|
||||
raise SeedDenied("Only an unlinked jobtracker-e2e-* direct child of system temp is allowed")
|
||||
database = root / "jobtracker.db"
|
||||
if (not database.is_file() or database.is_symlink() or (sys.platform == "win32" and database.is_junction())
|
||||
if (not database.is_file() or database.is_symlink() or database.is_junction()
|
||||
or database.resolve(strict=True) != database or database.stat().st_nlink != 1):
|
||||
raise SeedDenied("The unlinked existing direct jobtracker.db file is required")
|
||||
# EF's SQLite Guid converter writes uppercase canonical text.
|
||||
@@ -110,7 +110,7 @@ def temporary_fixture():
|
||||
yield root
|
||||
finally:
|
||||
assert root.parent == Path(tempfile.gettempdir()).resolve()
|
||||
assert root.name.startswith("jobtracker-e2e-operation-selftest-") and not root.is_symlink() and not (sys.platform == "win32" and root.is_junction())
|
||||
assert root.name.startswith("jobtracker-e2e-operation-selftest-") and not root.is_symlink() and not root.is_junction()
|
||||
|
||||
|
||||
def self_test() -> dict:
|
||||
|
||||
@@ -171,13 +171,8 @@ for (const [mode, language, width] of [["light", "en", 1440], ["dark", "nb", 144
|
||||
await expect(cancel).toBeFocused();
|
||||
await expect(confirm).toHaveAccessibleDescription(t.attachmentsDeleteConfirm.replace("{name}", "Reviewed æøå.txt"));
|
||||
await cancel.press("Shift+Tab");
|
||||
const messageRegion = confirm.getByRole("region", { name: t.attachmentsDeleteTitle, exact: true });
|
||||
await expect(messageRegion).toBeFocused();
|
||||
await messageRegion.press("Shift+Tab");
|
||||
await expect(confirm.getByRole("button", { name: t.attachmentsDelete, exact: true })).toBeFocused();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(messageRegion).toBeFocused();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(cancel).toBeFocused();
|
||||
await scan(page, info, "confirm", true);
|
||||
await capture(page, info, `confirm-${suffix}`);
|
||||
|
||||
@@ -113,7 +113,7 @@ function seedPending(info: TestInfo, owner: Owner) {
|
||||
expect(path.dirname(dataRoot)).toBe(realpathSync(os.tmpdir()));
|
||||
expect(path.basename(dataRoot)).toMatch(/^jobtracker-e2e-[A-Za-z0-9][A-Za-z0-9_-]*$/);
|
||||
const helper = path.resolve('e2e/helpers/seed-career-review.py');
|
||||
const result = spawnSync(process.env.PLAYWRIGHT_PYTHON_PATH || (process.platform === 'win32' ? 'python' : 'python3'), ['-X', 'utf8', helper], {
|
||||
const result = spawnSync('rtk', ['proxy', process.env.PLAYWRIGHT_PYTHON_PATH || 'python', '-X', 'utf8', helper], {
|
||||
input: JSON.stringify({ dataRoot, ownerId: owner.id, ownerEmail: owner.email, profile: incoming(),
|
||||
rawText: 'Synthetic pending extraction text — æøå', normalizedText: 'Synthetic pending normalized text; pending contact email; Norwegian B1.' }),
|
||||
encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024,
|
||||
|
||||
@@ -366,11 +366,7 @@ test('[P7-05 Discovery] keyboard native create and alert updates persist; delete
|
||||
const cancel = dialog.getByRole('button', { name: t.cancel, exact: true });
|
||||
await expect(cancel).toBeFocused();
|
||||
await page.keyboard.press('Shift+Tab');
|
||||
const messageRegion = dialog.getByRole('region', { name: await dialog.getByRole('heading').innerText(), exact: true });
|
||||
await expect(messageRegion).toBeFocused();
|
||||
await messageRegion.press('Shift+Tab');
|
||||
await expect(dialog.getByRole('button', { name: t.adminUsersDelete, exact: true })).toBeFocused();
|
||||
await page.keyboard.press('Tab'); await expect(messageRegion).toBeFocused();
|
||||
await page.keyboard.press('Tab'); await expect(cancel).toBeFocused();
|
||||
await page.keyboard.press('Enter');
|
||||
await expect(dialog).toHaveCount(0); await expect(deleteButton).toBeFocused();
|
||||
|
||||
@@ -42,7 +42,7 @@ function seedQueued(info: TestInfo, owner: Owner) {
|
||||
const metadataRoot = info.config.metadata.isolatedDataRoot;
|
||||
if (typeof metadataRoot !== 'string' || process.env.PLAYWRIGHT_REUSE_SERVERS === 'true') throw new Error('Operation seeding requires explicit isolated non-reused dataRoot');
|
||||
expect(path.isAbsolute(metadataRoot)).toBe(true); const dataRoot = realpathSync(metadataRoot); expect(path.dirname(dataRoot)).toBe(realpathSync(os.tmpdir())); expect(path.basename(dataRoot)).toMatch(/^jobtracker-e2e-[A-Za-z0-9][A-Za-z0-9_-]*$/);
|
||||
const result = spawnSync(process.env.PLAYWRIGHT_PYTHON_PATH || (process.platform === 'win32' ? 'python' : 'python3'), ['-X', 'utf8', path.resolve('e2e/helpers/seed-operation.py')], { input: JSON.stringify({ dataRoot, ownerId: owner.id, ownerEmail: owner.email }), encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 });
|
||||
const result = spawnSync('rtk', ['proxy', process.env.PLAYWRIGHT_PYTHON_PATH || 'python', '-X', 'utf8', path.resolve('e2e/helpers/seed-operation.py')], { input: JSON.stringify({ dataRoot, ownerId: owner.id, ownerEmail: owner.email }), encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 });
|
||||
expect(result.error, 'guarded helper must start').toBeUndefined(); expect(result.status, result.stderr).toBe(0); const value = JSON.parse(result.stdout) as { operationId: string }; expect(Object.keys(value)).toEqual(['operationId']); expect(value.operationId).toMatch(/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/); return value.operationId;
|
||||
}
|
||||
async function cancel(api: APIRequestContext, owner: Owner, id: string) { const value = await json<Operation>(await api.post(`${apiUrl}/operations/${id}/cancel`, { headers: owner.headers })); utcFields(value); expect(value).toMatchObject({ id, status: 'cancelled', canCancel: false, canRetry: true }); const notice = (await notices(api)).find(item => item.operationId === id)!; expect(notice).toBeDefined(); expect(notice).toMatchObject({ operationId: id, kind: 'operation_cancelled', linkPath: null, readAtUtc: null }); expect(notice.createdAtUtc).toBe(value.completedAtUtc); return { value, notice }; }
|
||||
|
||||
@@ -42,7 +42,7 @@ function seedQueued(info: TestInfo, owner: Owner) {
|
||||
const metadataRoot = info.config.metadata.isolatedDataRoot;
|
||||
if (typeof metadataRoot !== 'string' || process.env.PLAYWRIGHT_REUSE_SERVERS === 'true') throw new Error('Operation seeding requires explicit isolated non-reused dataRoot');
|
||||
expect(path.isAbsolute(metadataRoot)).toBe(true); const dataRoot = realpathSync(metadataRoot); expect(path.dirname(dataRoot)).toBe(realpathSync(os.tmpdir())); expect(path.basename(dataRoot)).toMatch(/^jobtracker-e2e-[A-Za-z0-9][A-Za-z0-9_-]*$/);
|
||||
const result = spawnSync(process.env.PLAYWRIGHT_PYTHON_PATH || (process.platform === 'win32' ? 'python' : 'python3'), ['-X', 'utf8', path.resolve('e2e/helpers/seed-operation.py')], { input: JSON.stringify({ dataRoot, ownerId: owner.id, ownerEmail: owner.email }), encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 });
|
||||
const result = spawnSync('rtk', ['proxy', process.env.PLAYWRIGHT_PYTHON_PATH || 'python', '-X', 'utf8', path.resolve('e2e/helpers/seed-operation.py')], { input: JSON.stringify({ dataRoot, ownerId: owner.id, ownerEmail: owner.email }), encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 });
|
||||
expect(result.error, 'guarded helper must start').toBeUndefined(); expect(result.status, result.stderr).toBe(0); const value = JSON.parse(result.stdout) as { operationId: string }; expect(Object.keys(value)).toEqual(['operationId']); expect(value.operationId).toMatch(/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/); return value.operationId;
|
||||
}
|
||||
async function cancel(api: APIRequestContext, owner: Owner, id: string) { const value = await json<Operation>(await api.post(`${apiUrl}/operations/${id}/cancel`, { headers: owner.headers })); utcFields(value); expect(value).toMatchObject({ id, status: 'cancelled', canCancel: false, canRetry: true }); const notice = (await notices(api)).find(item => item.operationId === id)!; expect(notice).toBeDefined(); expect(notice).toMatchObject({ operationId: id, kind: 'operation_cancelled', linkPath: null, readAtUtc: null }); expect(notice.createdAtUtc).toBe(value.completedAtUtc); return { value, notice }; }
|
||||
|
||||
@@ -268,7 +268,7 @@ for (const mode of ["light", "dark"] as const) for (const language of ["en", "nb
|
||||
? route.fulfill({ status: 204, body: "" }) : route.continue());
|
||||
await page.getByRole("button", { name: t.notifications, exact: true }).click();
|
||||
await expect(page.getByText("CV export failed")).toBeVisible();
|
||||
await expect(page.getByText(t.notificationsUnread, { exact: true })).toBeVisible();
|
||||
await expect(page.getByText(t.notificationsUnread)).toBeVisible();
|
||||
await capture(page, info, `utility-notifications-${suffix}`);
|
||||
await scan(page, info, `utility-notifications-${suffix}`, ".MuiPopover-paper");
|
||||
await page.getByRole("button", { name: t.notificationsMarkRead }).click();
|
||||
|
||||
Generated
+3
-3
@@ -7729,9 +7729,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.16.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz",
|
||||
"integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==",
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
|
||||
@@ -42,8 +42,7 @@ export default defineConfig({
|
||||
Auth__AdminEmail: "e2e@example.test",
|
||||
Auth__AdminPassword: "E2ePassword123!",
|
||||
Auth__AllowRegistration: "false",
|
||||
// The full browser suite shares one loopback IP. Real throttle contracts use the separate 10-permit fixture.
|
||||
RateLimits__AuthLoginPermitLimit: "1000",
|
||||
RateLimits__AuthLoginPermitLimit: "100",
|
||||
App__Version: "e2e-verification",
|
||||
App__CommitSha: "e2e1234",
|
||||
Cors__Origins__0: appUrl,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import '@testing-library/jest-dom';
|
||||
import { render, screen, fireEvent, act } from '@testing-library/react';
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import { ConfirmProvider, useConfirm } from './confirm';
|
||||
import { I18nProvider } from './i18n/I18nProvider';
|
||||
|
||||
@@ -31,10 +31,6 @@ test('renders app-owned confirmation dialog', async () => {
|
||||
expect(screen.getByRole('button', { name: /delete/i })).toBeInTheDocument();
|
||||
expect(screen.getByRole('dialog', { name: 'Delete job' })).toHaveAccessibleDescription('Are you sure?');
|
||||
expect(screen.getByRole('button', { name: 'Cancel' })).toHaveFocus();
|
||||
const messageRegion = screen.getByRole('region', { name: 'Delete job' });
|
||||
expect(messageRegion).toHaveAttribute('tabindex', '0');
|
||||
messageRegion.focus();
|
||||
expect(messageRegion).toHaveFocus();
|
||||
});
|
||||
|
||||
test('uses the selected language for shared dialog defaults', async () => {
|
||||
@@ -52,18 +48,3 @@ test('uses the selected language for shared dialog defaults', async () => {
|
||||
expect(screen.getByRole('button', { name: 'Bekreft' })).toBeInTheDocument();
|
||||
window.localStorage.removeItem('uiLanguage');
|
||||
});
|
||||
|
||||
test('finishing the opening transition preserves focus already moved inside the dialog', async () => {
|
||||
jest.useFakeTimers();
|
||||
try {
|
||||
render(<ConfirmProvider><Demo /></ConfirmProvider>);
|
||||
fireEvent.click(screen.getByRole('button', { name: /open confirm/i }));
|
||||
expect(screen.getByRole('button', { name: 'Cancel' })).toHaveFocus();
|
||||
const message = screen.getByRole('region', { name: 'Delete job' });
|
||||
act(() => message.focus());
|
||||
await act(async () => { jest.advanceTimersByTime(1000); });
|
||||
expect(message).toHaveFocus();
|
||||
} finally {
|
||||
jest.useRealTimers();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,8 +23,8 @@ const ConfirmContext = createContext<ConfirmContextValue | null>(null);
|
||||
export function ConfirmProvider({ children }: { children: React.ReactNode }) {
|
||||
const i18n = useOptionalI18n();
|
||||
const messageId = useId();
|
||||
const titleId = useId();
|
||||
const resolverRef = useRef<((value: boolean) => void) | null>(null);
|
||||
const cancelButtonRef = useRef<HTMLButtonElement>(null);
|
||||
const [state, setState] = useState<ConfirmState>({
|
||||
open: false,
|
||||
message: "",
|
||||
@@ -60,12 +60,13 @@ export function ConfirmProvider({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<ConfirmContext.Provider value={value}>
|
||||
{children}
|
||||
<Dialog open={state.open} onClose={() => closeWith(false)} aria-labelledby={titleId} aria-describedby={messageId} fullWidth maxWidth="xs"
|
||||
<Dialog open={state.open} onClose={() => closeWith(false)} aria-describedby={messageId} fullWidth maxWidth="xs"
|
||||
slotProps={{
|
||||
paper: { sx: { borderRadius: 3, border: 1, borderColor: "divider", backgroundImage: "none" } },
|
||||
transition: { onEntered: () => cancelButtonRef.current?.focus() },
|
||||
}}>
|
||||
<DialogTitle id={titleId} sx={{ pb: 1, fontWeight: 800 }}>{state.title}</DialogTitle>
|
||||
<DialogContent role="region" aria-labelledby={titleId} tabIndex={0}>
|
||||
<DialogTitle sx={{ pb: 1, fontWeight: 800 }}>{state.title}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Alert severity={state.destructive ? "warning" : "info"} variant="outlined" sx={{ mb: 2 }}>
|
||||
{state.destructive
|
||||
? i18n?.t("confirmDestructiveHint") ?? "This action may be hard to undo."
|
||||
@@ -74,7 +75,7 @@ export function ConfirmProvider({ children }: { children: React.ReactNode }) {
|
||||
<Typography id={messageId} sx={{ color: "text.secondary" }}>{state.message}</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions sx={{ px: 3, pb: 2.5, gap: 1 }}>
|
||||
<Button autoFocus onClick={() => closeWith(false)}>{state.cancelLabel}</Button>
|
||||
<Button ref={cancelButtonRef} autoFocus onClick={() => closeWith(false)}>{state.cancelLabel}</Button>
|
||||
<Button color={state.destructive ? "error" : "primary"} variant="contained" onClick={() => closeWith(true)}>
|
||||
{state.confirmLabel}
|
||||
</Button>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
"""Exercise the actual workflow's narrow corruption guard, without starting CI."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
WORKFLOW = Path(__file__).resolve().parents[1] / '.gitea/workflows/ci-deploy.yml'
|
||||
BASH = str(Path('C:/Program Files/Git/bin/bash.exe')) if os.name == 'nt' else shutil.which('bash')
|
||||
|
||||
|
||||
class BrowserRuntimeRetryTests(unittest.TestCase):
|
||||
def permits_retry(self, log):
|
||||
text = WORKFLOW.read_text(encoding='utf-8')
|
||||
end = text.index(' echo "Browser runtime source appears corrupted')
|
||||
start = text.rfind('\n if ', 0, end) + 1
|
||||
guard = text[start:end]
|
||||
self.assertTrue(guard.strip().startswith('if '))
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
fixture = Path(folder) / 'smoke.log'
|
||||
fixture.write_text(log, encoding='utf-8')
|
||||
result = subprocess.run([BASH, '-c', guard + '\nexit 0\nelse\nexit 1\nfi'],
|
||||
env={**os.environ, 'smoke_log': fixture.as_posix()}, capture_output=True, text=True)
|
||||
self.assertIn(result.returncode, [0, 1], result.stderr)
|
||||
return result.returncode == 0
|
||||
|
||||
def test_captured_playwright_source_corruption(self):
|
||||
self.assertTrue(self.permits_retry('/workspace/node_modules/playwright-core/lib/utilsBundle.js:35841\n'
|
||||
'const { items }$= this;\nSyntaxError: Missing initializer in destructuring declaration'))
|
||||
|
||||
def test_existing_axe_source_corruption(self):
|
||||
self.assertTrue(self.permits_retry('AxeBuilder.analyze\npage.evaluate: ReferenceError: invalid runtime source'))
|
||||
|
||||
def test_application_assertion_stays_terminal(self):
|
||||
self.assertFalse(self.permits_retry('expect(region).not.toBeVisible() failed'))
|
||||
|
||||
def test_browser_crash_alone_stays_terminal(self):
|
||||
self.assertFalse(self.permits_retry('Error: page.evaluate: Target crashed'))
|
||||
|
||||
def test_user_javascript_syntax_error_stays_terminal(self):
|
||||
self.assertFalse(self.permits_retry('src/example.js:1\nconst { items }$= this;\nSyntaxError: Missing initializer in destructuring declaration'))
|
||||
|
||||
def test_incomplete_signature_stays_terminal(self):
|
||||
self.assertFalse(self.permits_retry('node_modules/playwright-core/lib/utilsBundle.js:35841\nSyntaxError: Missing initializer in destructuring declaration'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -646,8 +646,6 @@ def _ollama_generate(prompt: str, *, json_mode: bool, temperature: float, timeou
|
||||
"stream": False,
|
||||
"options": {"temperature": temperature},
|
||||
}
|
||||
if OLLAMA_MODEL.split(":", 1)[0] == "qwen3.5":
|
||||
payload["think"] = False
|
||||
if json_mode:
|
||||
payload["format"] = "json"
|
||||
body = _http_post_json(f"{OLLAMA_BASE_URL}/api/generate", payload, {}, timeout)
|
||||
|
||||
@@ -8,7 +8,6 @@ import textwrap
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from docx import Document
|
||||
from fastapi.testclient import TestClient
|
||||
from PIL import Image
|
||||
@@ -254,55 +253,6 @@ def test_provider_defaults_to_ollama_and_is_unchanged(monkeypatch):
|
||||
assert captured["body"]["options"]["temperature"] == 0.1
|
||||
|
||||
|
||||
@pytest.mark.parametrize("ollama_model", ["qwen3.5:9b-q4_K_M", "qwen3.5"])
|
||||
@pytest.mark.parametrize("json_mode", [False, True])
|
||||
def test_qwen35_requests_nonthinking_output_without_consuming_thinking(monkeypatch, ollama_model, json_mode):
|
||||
module = load_app_module(monkeypatch, ollama_model=ollama_model)
|
||||
captured = {}
|
||||
output = '{"score": 7}' if json_mode else "Rewritten CV text"
|
||||
|
||||
def fake_urlopen(req, timeout=None):
|
||||
captured["body"] = json.loads(req.data.decode("utf-8"))
|
||||
captured["timeout"] = timeout
|
||||
captured["url"] = req.full_url
|
||||
return _FakeResponse({
|
||||
"response": output if captured["body"].get("think") is False else "",
|
||||
"thinking": "Private reasoning must never become candidate text.",
|
||||
})
|
||||
|
||||
monkeypatch.setattr(module.urllib_request, "urlopen", fake_urlopen)
|
||||
result = module._ollama_generate_json("synthetic prompt") if json_mode else module._ollama_generate_text("synthetic prompt")
|
||||
|
||||
assert result == ({"score": 7} if json_mode else output)
|
||||
expected = {
|
||||
"model": ollama_model,
|
||||
"prompt": "synthetic prompt",
|
||||
"stream": False,
|
||||
"options": {"temperature": 0.1 if json_mode else 0.2},
|
||||
"think": False,
|
||||
}
|
||||
if json_mode:
|
||||
expected["format"] = "json"
|
||||
assert captured["body"] == expected
|
||||
assert captured["url"] == f"{module.OLLAMA_BASE_URL}/api/generate"
|
||||
assert captured["timeout"] == (120 if json_mode else 180)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("ollama_model", ["qwen2.5:7b", "qwen3:8b", "qwen3.5-plus:9b"])
|
||||
def test_other_ollama_model_payloads_remain_unchanged(monkeypatch, ollama_model):
|
||||
module = load_app_module(monkeypatch, ollama_model=ollama_model)
|
||||
captured = {}
|
||||
_install_fake_urlopen(monkeypatch, module, {"response": " Candidate text ", "thinking": "Reasoning"}, captured)
|
||||
|
||||
assert module._ollama_generate_text("synthetic prompt") == "Candidate text"
|
||||
assert captured["body"] == {
|
||||
"model": ollama_model,
|
||||
"prompt": "synthetic prompt",
|
||||
"stream": False,
|
||||
"options": {"temperature": 0.2},
|
||||
}
|
||||
|
||||
|
||||
def test_local_success_wins_even_when_external_fallback_is_permitted(monkeypatch):
|
||||
monkeypatch.setenv("AI_PROVIDER", "gemini")
|
||||
monkeypatch.setenv("GEMINI_API_KEY", "test-key")
|
||||
|
||||
Reference in New Issue
Block a user