Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
34576a4
Preserve literal folder feed paths and patterns
KAVentures Nov 16, 2026
373168d
Show partial scheduled folder feed runs
KAVentures Nov 16, 2026
3b7d04a
Cover schedule refresh and combined partial states
KAVentures Nov 16, 2026
8bec2ed
Reconcile literal folder-feed pattern/path handling with updated read…
KAVentures Nov 17, 2026
9fbde26
Reconcile scheduled partial folder-feed status with latest literal-pa…
KAVentures Nov 17, 2026
a6de33d
Reconcile literal folder-feed paths after #954 integration
KAVentures Nov 17, 2026
05e1a26
Reconcile partial folder-feed status after #962 integration
KAVentures Nov 17, 2026
8117b72
Reconcile literal folder-feed paths with updated failure-review chain
KAVentures Nov 17, 2026
022281b
Reconcile scheduled partial feed status with updated literal-path parent
KAVentures Nov 17, 2026
d37066e
fix(folder feeds): read fresh file metadata for settle checks on Windows
KAVentures Nov 19, 2026
bb9451b
test(folder feeds): preserve exact fixture bytes across Windows and Unix
KAVentures Nov 19, 2026
1c39e11
fix(folder feeds): fetch fresh metadata for settle checks on Windows
KAVentures Nov 19, 2026
6684ffd
test(folder feeds): use identical CSV fixture bytes on Windows and Unix
KAVentures Nov 19, 2026
5f5b112
fix(folder feeds): keep synthetic entry error tests while refreshing …
KAVentures Nov 19, 2026
47700df
fix(folder feeds): preserve simulated metadata errors while avoiding …
KAVentures Nov 19, 2026
42c8198
chore(stack): inherit Windows folder metadata fix from parent #962
KAVentures Nov 19, 2026
456f054
chore(stack): inherit exact-byte fixture helper from parent #962
KAVentures Nov 19, 2026
c266076
test(browser): align Jira readiness assertion with current dashboard …
KAVentures Nov 19, 2026
a49dabd
test(browser): align Jira readiness assertion with current dashboard …
KAVentures Nov 19, 2026
35c1b2e
fix(jira): align native readiness UI copy with current accepted brows…
KAVentures Nov 19, 2026
3e10544
fix(jira): keep literal-path feed UI on current Jira readiness wording
KAVentures Nov 19, 2026
0b9ecf0
Merge pull request #964 from KAVentures/feat/folder-feed-partial-status
KAVentures Nov 19, 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
30 changes: 30 additions & 0 deletions .github/workflows/folder-feed-literal-paths.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Folder feed literal paths acceptance
on:
pull_request:
paths:
- 'server/event_log_folder_feeds.py'
- 'dashboard/event_log_workspace.js'
- 'tests/test_event_log_folder_feeds.py'
- 'tests/browser/event_log_folder_feed_literal_paths.cjs'
- 'tests/browser/process_logs_app.py'
- '.github/workflows/folder-feed-literal-paths.yml'
permissions:
contents: read
jobs:
folder-feed-literal-paths-acceptance:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: python -m pip install -e '.[dev,gateway]'
- run: python -m pytest -q tests/test_event_log_folder_feeds.py tests/test_event_log_append.py tests/test_local_scheduler.py
- run: |
npm install --prefix "$RUNNER_TEMP/owg-browser" playwright@1.64.1 axe-core@4.10.3
node "$RUNNER_TEMP/owg-browser/node_modules/playwright/cli.js" install --with-deps chromium || node "$RUNNER_TEMP/owg-browser/node_modules/playwright/cli.js" install chromium
- run: NODE_PATH="$RUNNER_TEMP/owg-browser/node_modules" node tests/browser/event_log_folder_feed_literal_paths.cjs
32 changes: 32 additions & 0 deletions .github/workflows/folder-feed-partial-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Scheduled folder feed partial status acceptance
on:
pull_request:
paths:
- 'server/event_log_folder_feeds.py'
- 'server/local_scheduler.py'
- 'dashboard/basic_mode.js'
- 'tests/test_event_log_folder_feeds.py'
- 'tests/browser/event_log_folder_feed_partial_status.cjs'
- 'tests/browser/folder_feed_partial_status_app.py'
- 'tests/browser/process_logs_app.py'
- '.github/workflows/folder-feed-partial-status.yml'
permissions:
contents: read
jobs:
folder-feed-partial-status-acceptance:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: python -m pip install -e '.[dev,gateway]'
- run: python -m pytest -q tests/test_event_log_folder_feeds.py tests/test_local_scheduler.py
- run: |
npm install --prefix "$RUNNER_TEMP/owg-browser" playwright@1.64.1 axe-core@4.10.3
node "$RUNNER_TEMP/owg-browser/node_modules/playwright/cli.js" install --with-deps chromium || node "$RUNNER_TEMP/owg-browser/node_modules/playwright/cli.js" install chromium
- run: NODE_PATH="$RUNNER_TEMP/owg-browser/node_modules" node tests/browser/event_log_folder_feed_partial_status.cjs
17 changes: 13 additions & 4 deletions dashboard/basic_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@

// ------------------------------------------------------------------ Privacy tab

let refreshScheduleList = () => {};
function ensurePrivacyTab() {
if ($('#tab-privacy')) return;
const tabs = $('.tabs'), main = $('main');
Expand All @@ -145,7 +146,7 @@
tab.setAttribute('aria-selected', 'false');
tab.textContent = 'Privacy';
tabs.insertBefore(tab, $('#tab-settings') || null);
tab.addEventListener('click', () => { window.activateTab?.('privacy'); refreshPrivacy(); });
tab.addEventListener('click', () => { window.activateTab?.('privacy'); refreshPrivacy(); refreshScheduleList(); });

const panel = document.createElement('section');
panel.className = 'tabpanel';
Expand Down Expand Up @@ -1185,16 +1186,23 @@
throw new Error('Enter a timezone and two different valid 24-hour quiet-hour times.');
return windowSpec;
};
let scheduleRefreshEpoch = 0;
const refreshSchedules = async () => {
const epoch = ++scheduleRefreshEpoch;
const state = await api('/v1/schedules').catch(() => null);
if (!scheduleList || !state) return;
if (!scheduleList || !state || epoch !== scheduleRefreshEpoch) return;
scheduleList.replaceChildren();
for (const item of state.schedules || []) {
const line = document.createElement('div');
line.className = 'pv-row pv-sub';
const text = document.createElement('span');
const kindLabel = {retained_jira_profile: 'Jira profile ', event_log_signals: 'Signals for ',
event_log_report: 'Event log report for ', event_log_folder_feed: 'Folder feed '};
const partialLabel = {'partial:more_files_pending': 'more matching files need checking',
'partial:files_not_ready': 'some matching files are not ready',
'partial:more_files_pending_and_not_ready': 'more files need checking and some are not ready'};
text.textContent = (item.kind === 'local_backup' ? 'Unencrypted local backup'
: (item.kind === 'retained_jira_profile' ? 'Jira profile ' : 'Signals for ') + item.target_id) +
: (kindLabel[item.kind] || 'Scheduled job ') + item.target_id) +
' · every ' + item.interval_minutes + ' min · ' + (item.enabled ? 'next ' + String(item.next_run_at || '').slice(0, 16).replace('T', ' ')
: (item.paused_reason === 'signal_rules_changed_requires_reapproval' ? 'paused: saved signal rules changed'
: (item.paused_reason ? 'paused after repeated failures' : 'paused'))) +
Expand All @@ -1204,7 +1212,7 @@
(item.quiet_hours ? ' · quiet ' + item.quiet_hours.start + '–' + item.quiet_hours.end +
' ' + item.quiet_hours.timezone + (item.quiet_hours_active ? ' (now)' : '') : '') +
(item.last_deferred_until ? ' · last quiet deferral until ' + String(item.last_deferred_until).slice(0, 16).replace('T',' ') + ' UTC' : '') +
(item.last_result ? ' · last: ' + item.last_result : '');
(item.last_result ? ' · last: ' + (partialLabel[item.last_result] || item.last_result) : '');
const toggle = document.createElement('button');
toggle.type = 'button'; toggle.className = 'secondary'; toggle.textContent = item.enabled ? 'Pause' : 'Resume';
const rulesNeedReview = item.kind === 'event_log_signals' &&
Expand Down Expand Up @@ -1315,6 +1323,7 @@
} catch (error) { if (scheduleStatus) scheduleStatus.textContent = error.message || 'Could not add the schedule.'; }
refreshSchedules();
};
refreshScheduleList = refreshSchedules;
refreshSchedules();
const semanticStatus = panel.querySelector('#pvSemanticStatus');
const showSemantic = state => { if (semanticStatus && state) semanticStatus.textContent = state.enabled ? 'On: ' + state.model + ' at ' + state.base_url : 'Off.'; };
Expand Down
6 changes: 3 additions & 3 deletions dashboard/event_log_workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@
const result=await getJSON(endpoint);
if(capability===capabilityVersion){nativeReady=result.native_case_selection_configured===true;sync();}
if(request!==version)return;
message.textContent=result.configured&&basis.value==='native_issue_keys'&&!nativeReady?'An administrator must separately authorize native issue-key ingestion.':result.configured?'Ready for explicitly confirmed manual reads. A successful read is historical coverage, not verified completeness.':'An administrator must configure the separate retained Jira opt-in and OAuth read scopes. No credentials are entered here.';
message.textContent=result.configured&&basis.value==='native_issue_keys'&&!nativeReady?'An administrator must separately authorize native issue-key ingestion.':result.configured?'Profiles can be read manually or scheduled separately. A successful read is historical coverage, not verified completeness.':'An administrator must configure the separate retained Jira opt-in and OAuth read scopes. No credentials are entered here.';
out.replaceChildren();
for(const profile of result.profiles){
const item=el('div',null,'card');item.dataset.profileId=profile.profile_id;
Expand Down Expand Up @@ -1475,7 +1475,7 @@
box.appendChild(el('div','Point this log at a folder where a system drops exports. Each run appends new files that match the pattern, using the column mapping of this log\u2019s latest CSV import. Files are read, never changed or deleted. A file is appended once, by its content.','muted'));
const list=el('div');list.id='owgFolderFeedList';list.setAttribute('role','status');
const folder=input('owgFolderFeedFolder','text','for example /Users/me/Exports/orders');folder.size=40;
const pattern=input('owgFolderFeedPattern','text');pattern.value='*.csv';pattern.maxLength=84;
const pattern=input('owgFolderFeedPattern','text');pattern.value='*.csv';pattern.maxLength=164;
const consent=input('owgFolderFeedConsent','checkbox');
const consentLabel=el('label',' Read files from this folder and store their events with the log on this computer');consentLabel.prepend(consent);
const create=button('Create feed','secondary');create.id='owgFolderFeedCreate';create.disabled=true;
Expand Down Expand Up @@ -1540,7 +1540,7 @@
latest?latest.name+' \u2014 '+(latest.outcome==='appended'?Number(latest.added_events).toLocaleString()+' events added'+(latest.warning?' · '+latest.warning:''):'not appended: '+latest.error):'\u2014',wrap];})));
};
create.onclick=async()=>{create.disabled=true;
try{await api(base,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({folder:folder.value.trim(),pattern:pattern.value.trim(),confirm_folder_reads:true})});
try{await api(base,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({folder:folder.value,pattern:pattern.value,confirm_folder_reads:true})});
consent.checked=false;out.replaceChildren(el('div','Feed created. Run it now or every day.'));render(await getJSON(base));}
catch(error){out.replaceChildren(el('div',error.message,'muted'));ready();}};
getJSON(base).then(r=>{if(generation===state.generation)render(r);}).catch(error=>list.replaceChildren(el('div',error.message,'muted')));
Expand Down
10 changes: 8 additions & 2 deletions docs/EVENT_LOG_WORKSPACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,10 @@ hand.

- You create a feed for one absolute folder and one file pattern
(`orders-*.csv`; `.csv`, `.tsv` or `.txt`), and you confirm that the folder
may be read. Subfolders are not read.
may be read. Folder paths and filename patterns preserve spaces and Unicode
literally; wildcard characters in the pattern retain their usual meaning.
Path separators and control characters are not permitted in the pattern,
and subfolders are not read.
- The mapping is copied when the feed is created. A changed mapping needs a
new feed.
- A file is appended once, identified by the SHA-256 of its content. A renamed
Expand Down Expand Up @@ -1350,7 +1353,10 @@ hand.
deleted.
- "Run every day" schedules the feed on the local scheduler (job kind
`event_log_folder_feed`). Deleting the feed or the log removes the feed, its
file records and its schedule.
file records and its schedule. A scheduled run is labelled partial when
files are not ready or additional matching files still need checking; it
remains enabled and checks again at its normal interval. Partial status is
not evidence that the folder or the source system is fully up to date.

| Route | Purpose |
| --- | --- |
Expand Down
41 changes: 32 additions & 9 deletions server/event_log_folder_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
MAX_FEEDS_PER_LOG = 5
MAX_FILES_PER_RUN = 20
SETTLE_SECONDS = 60
_PATTERN = re.compile(r"^[A-Za-z0-9 _.*?\[\]-]{1,80}\.(csv|tsv|txt)$", re.IGNORECASE)
_PATTERN = re.compile(r"^.{1,80}\.(csv|tsv|txt)$", re.IGNORECASE)
_UNSAFE_PATTERN = re.compile(r"[/\\\x00-\x1f\x7f-\x9f\ud800-\udfff]")
_FEED_ID = re.compile(r"^feed_[0-9a-f]{16}$")
_SHA256 = re.compile(r"^[0-9a-f]{64}$")
FAILURE_PAGE_SIZE = 50
Expand All @@ -75,14 +76,23 @@ def _latest_mapping(conn, log_id: str) -> dict[str, Any]:


def _folder(value: Any) -> Path:
if not isinstance(value, str) or not value.strip() or len(value) > 1000 or "\x00" in value:
if (not isinstance(value, str) or not value.strip() or len(value) > 1000 or "\x00" in value
or any(0xD800 <= ord(char) <= 0xDFFF for char in value)):
raise EventLogWorkspaceError("give the folder as an absolute path")
path = Path(value.strip()).expanduser()
# Whitespace can be part of a real path. Trimming it can redirect a feed
# to a different, unselected sibling directory.
try:
path = Path(value).expanduser()
except (OSError, RuntimeError):
raise EventLogWorkspaceError("give the folder as an absolute path") from None
if not path.is_absolute():
raise EventLogWorkspaceError("give the folder as an absolute path")
if not path.is_dir():
raise EventLogWorkspaceError("the folder does not exist or is not a folder")
return path.resolve()
try:
if not path.is_dir():
raise EventLogWorkspaceError("the folder does not exist or is not a folder")
return path.resolve()
except (OSError, RuntimeError):
raise EventLogWorkspaceError("the folder does not exist or is not a folder") from None


def create(log_id: str, spec: Any) -> dict[str, Any]:
Expand All @@ -91,8 +101,10 @@ def create(log_id: str, spec: Any) -> dict[str, Any]:
if spec.get("confirm_folder_reads") is not True:
raise EventLogWorkspaceError("explicit confirmation to read files from this folder is required")
folder = _folder(spec.get("folder"))
pattern = spec.get("pattern") or "*.csv"
if not isinstance(pattern, str) or not _PATTERN.fullmatch(pattern):
pattern = spec.get("pattern", "*.csv")
if pattern is None or pattern == "":
pattern = "*.csv"
if not isinstance(pattern, str) or not _PATTERN.fullmatch(pattern) or _UNSAFE_PATTERN.search(pattern):
raise EventLogWorkspaceError("the file pattern must be a simple name pattern ending in .csv, .tsv or .txt")
with workspace._LOCK:
conn = workspace._connect()
Expand Down Expand Up @@ -252,7 +264,12 @@ def note_unreadable(name: str) -> None:
if not fnmatch.fnmatch(entry.name, feed["pattern"]):
continue
try:
info = entry.stat(follow_symlinks=False)
# Real Windows DirEntry metadata may retain stale modified times;
# synthetic DirEntry-like test objects must still use stat().
if os.name == "nt" and isinstance(entry, os.DirEntry):
info = (folder / entry.name).stat(follow_symlinks=False)
else:
info = entry.stat(follow_symlinks=False)
except FileNotFoundError:
scan_deferred += 1
continue # removed during enumeration
Expand Down Expand Up @@ -383,6 +400,12 @@ def run_scheduled(feed_id: str) -> tuple[str, float]:
return "failed:quality_report_unavailable", 0.0
if result["files_previously_failed"]:
return "failed:previously_failed_files", 0.0
if result["more_files_waiting"] and result["files_still_being_written"]:
return "partial:more_files_pending_and_not_ready", 0.0
if result["more_files_waiting"]:
return "partial:more_files_pending", 0.0
if result["files_still_being_written"]:
return "partial:files_not_ready", 0.0
return f"succeeded:{result['files_appended']}_files_appended", 0.0


Expand Down
Loading