LifeMate — Personal, Family & Learning Companion
test: use Android-supported numeric task flags for fixture launch
Quinn White committed
Oct 19, 2026 at 03:29 UTC
c1a22bdd63ce9f7bb6300740d113fabb7cdcd8d6
6 files changed
+66
-9
PROJECT_STATE.md
+1
-1
@@ -4,7 +4,7 @@
4
5
[PR36](https://github.com/davoodmehraban89/LifeMate/pull/36) فقط fixture و ابزار آزمون شبیهساز است؛ Flutter/Android عملیاتی، Backend و APK تحویلی0.7.2+8 تغییر نکردهاند. پورت اصلی با رکورد ساختگی و برچسب صریحِ تأیید سرور شبیهسازیشده استفاده میشود. دستگاه فیزیکی/بستهٔ از قبل نصبشده رد میشود؛ fixture APK توزیع نمیشود.
6
7
-**VERIFIED در7fb737d:** Flutter282pass، host21pass و analyze بدون ایراد؛ CI عمومی39192545903 موفق با Backend308pass، role41 و regression96، buildوب و APKdebug. **اجرای شبیهساز39192545919 شکست خورد**: `fixture_process_did_not_exit`؛ نصب تازه و inspect موفق بودند، پذیرش رسیدن اعلان انجام نشد. [شکست حفظشده](docs/audits/evidence/android-reminder-ci-first-2026-10-19.json) و [دستورهای محلی](docs/audits/evidence/android-reminder-tooling-2026-10-19.json). اجرای دوم39193398410، بستهشدن پردازش را پس از۴تلاش تأیید کرد، ولی دریافت markerصفحهٔ scheduleشکست خورد؛ [شکست دوم](docs/audits/evidence/android-reminder-ci-second-2026-10-19.json). ابزار اکنون taskساختگی خودش را با NEW_TASK/CLEAR_TASKباز میکند؛ وضعیت بومی و اعلانها پاک نمیشوند. host25تست موفق؛ اجرای بعدی Androidهنوز UNVERIFIED است. CIعمومی دوم39193398238 بر837f323نیز موفق شد.
7
+**VERIFIED در7fb737d:** Flutter282pass، host21pass و analyze بدون ایراد؛ CI عمومی39192545903 موفق با Backend308pass، role41 و regression96، buildوب و APKdebug. **اجرای شبیهساز39192545919 شکست خورد**: `fixture_process_did_not_exit`؛ نصب تازه و inspect موفق بودند، پذیرش رسیدن اعلان انجام نشد. [شکست حفظشده](docs/audits/evidence/android-reminder-ci-first-2026-10-19.json) و [دستورهای محلی](docs/audits/evidence/android-reminder-tooling-2026-10-19.json). اجرای دوم39193398410، بستهشدن پردازش را پس از۴تلاش تأیید کرد، ولی دریافت markerصفحهٔ scheduleشکست خورد؛ [شکست دوم](docs/audits/evidence/android-reminder-ci-second-2026-10-19.json). ابزار اکنون taskساختگی خودش را با NEW_TASK/CLEAR_TASKباز میکند؛ وضعیت بومی و اعلانها پاک نمیشوند. host25تست موفق؛ اجرای سوم39194206345نیز باخطای فرمان ابزار شکست خورد؛ [گواه](docs/audits/evidence/android-reminder-ci-third-2026-10-19.json). NEW_TASKنام خطفرمان مستقلی ندارد؛ مقدار مستند `-f 0x10008000`جایگزین شد. اجرای بعدی Androidهنوز UNVERIFIED است. CIعمومی دوم39193398238 بر837f323نیز موفق شد.
8
9
**VERIFIED خواندنی:** GETباTLSمعتبر در19اکتبر روی سه مسیر عمومی `app.lifeguide.ir/config.json`،`/api/health` و`/health` هر سه404 داد؛ APIسازگار از این مسیرها تأیید نشد. [رسید](docs/audits/evidence/public-api-paths-2026-10-19.json). این آزمون دسترسی از ایران یا تمام مسیرهای دامنه نیست. هیچ deploy،merge،DNS،حساب/داده واقعی یا تغییر سیاستی انجام نشده است. نصب/اعلان/صدا/باتری روی گوشی، Safari، ورود خصوصی کودک و APIعمومی همچنان **UNVERIFIED/باز** هستند. [راهنمای آزمون](docs/operations/ANDROID_REMINDER_ACCEPTANCE.md).
10
apps/lifemate/tool/test_native_reminders_android.py
+6
-3
@@ -311,14 +311,17 @@ class Harness:
311
route = "/" + mode + "?nonce=" + nonce
312
if mode == "schedule":
313
route += "&delay=45"
314
- self.receipt["currentPhase"] = "waiting_" + mode + "_marker"
314
+ self.receipt["currentPhase"] = "starting_" + mode + "_activity"
315
# A killed singleTop activity can retain its old route in task history.
316
# Recreate only this fixture's task so Flutter main gets the new intent.
317
- output = self.adb.shell("am", "start", "-W", "--activity-new-task",
318
- "--activity-clear-task", "-n", PACKAGE + "/.MainActivity",
317
+ # Intent.parseCommandArgs accepts -f; NEW_TASK has no named CLI option.
318
+ # 0x10008000 = FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK.
319
+ output = self.adb.shell("am", "start", "-W", "-f", "0x10008000",
320
+ "-n", PACKAGE + "/.MainActivity",
321
"--es", "route", route)
322
require("Error" not in output and "Exception" not in output,
323
"fixture_activity_launch_failed")
324
+ self.receipt["currentPhase"] = "waiting_" + mode + "_marker"
325
until = self.clock() + 30
326
observed_modes = set()
327
fixture_error_seen = False
apps/lifemate/tool/test_native_reminders_android_test.py
+8
-3
@@ -122,8 +122,13 @@ class SyntheticEmulator(FakeAdb):
122
f" android.title=String ({subject.COMPANION})\n"
123
f" android.text=String ({body})\n")
124
if parts[:3] == ("shell", "am", "start"):
125
+ # Android 15 Intent.parseCommandArgs has -f and clear-task, but
126
+ # rejects the nonexistent --activity-new-task named option.
127
+ if "--activity-new-task" in parts:
128
+ raise subject.AcceptanceError("adb_command_failed")
129
self.alive = True
126
- fresh_task = "--activity-new-task" in parts and "--activity-clear-task" in parts
130
+ flags = int(parts[parts.index("-f") + 1], 0) if "-f" in parts else 0
131
+ fresh_task = flags & 0x10008000 == 0x10008000
132
if not self.restore_retained_task or fresh_task or self.retained_route is None:
133
self.retained_route = parts[-1]
134
route = urlparse(self.retained_route)
@@ -388,8 +393,8 @@ class LifecycleTest(unittest.TestCase):
393
"schedule", "suppress", "schedule", "off"])
394
for parts in adb.calls:
395
if parts[:3] == ("shell", "am", "start"):
391
- self.assertIn("--activity-new-task", parts)
392
- self.assertIn("--activity-clear-task", parts)
396
+ self.assertNotIn("--activity-new-task", parts)
397
+ self.assertEqual(parts[parts.index("-f") + 1], "0x10008000")
398
self.assertIn(subject.PACKAGE + "/.MainActivity", parts)
399
400
def test_marker_timeout_reports_only_known_modes_and_error_boolean(self):
docs/audits/evidence/android-reminder-ci-third-2026-10-19.json
new
+41
@@ -0,0 +1,41 @@
1
+{
2
+ "status": "VERIFIED_FAILURE",
3
+ "runId": 39194206345,
4
+ "sourceCommit": "586fa3cb72ebee5240e1d656abd6bfb1d6ea9933",
5
+ "command": "gh run view39194206345 --log-failed",
6
+ "source": "Sanitized receipt extracted from official completed job log; artifact ZIP not verified",
7
+ "artifactZipIntegrity": "UNVERIFIED",
8
+ "receipt": {
9
+ "schemaVersion": 1,
10
+ "result": "FAIL",
11
+ "scope": "synthetic API 35 emulator only",
12
+ "currentPhase": "waiting_inspect_marker",
13
+ "simulatedServerAcknowledgement": true,
14
+ "limitations": {
15
+ "physicalDevice": "UNVERIFIED",
16
+ "reboot": "UNVERIFIED",
17
+ "Doze": "UNVERIFIED",
18
+ "soundOrVibration": "UNVERIFIED",
19
+ "permissionConsentUI": "UNVERIFIED",
20
+ "realServerAcknowledgement": "UNVERIFIED",
21
+ "signedRelease": "UNVERIFIED"
22
+ },
23
+ "checks": {
24
+ "emulatorAndFreshInstallGates": "PASS"
25
+ },
26
+ "apk": {
27
+ "sha256": "dad4f1c4dab33feda67f6cadd2c59ff9a258ee80964df43e0ef364b69bda896c",
28
+ "package": "ir.lifeguide.app",
29
+ "debuggable": true,
30
+ "targetSdkVersion": 36
31
+ },
32
+ "lastProcessState": "ABSENT",
33
+ "processExit": {
34
+ "confirmedAbsent": true,
35
+ "ordinaryKillAttempts": 1
36
+ },
37
+ "error": "adb_command_failed"
38
+ },
39
+ "interpretation": "Failure awaiting first inspect. Proposed --activity-new-task is absent from Android15 Intent.parseCommandArgs; -f Integer.decode is supported. Numeric NEW_TASK|CLEAR_TASK is0x10008000. Production app unchanged; actual notification acceptance still UNVERIFIED.",
40
+ "reference": "https://github.com/aosp-mirror/platform_frameworks_base/blob/android-15.0.0_r1/core/java/android/content/Intent.java"
41
+}
docs/audits/evidence/android-reminder-tooling-2026-10-19.json
+7
-1
@@ -48,9 +48,15 @@
48
"command": "python3 -m unittest discover -s apps/lifemate/tool -p '*_test.py' -v",
49
"output": "Ran25 tests in0.010s; OK",
50
"note": "Retained-task initialroute regression; task reset only on isolated fixture; sanitized retained-log diagnostics. No local adb."
51
+ },
52
+ {
53
+ "status": "VERIFIED",
54
+ "command": "python3 -m unittest discover -s apps/lifemate/tool -p '*_test.py' -v",
55
+ "output": "25 tests OK after numeric-fix and precise starting/waiting phase labels",
56
+ "note": "Exact Android15 Intent.java source validates -f0x10008000. Virtualmodel first rejected old nonexistent namedoption, then passed afterfix. No local adb."
57
}
58
],
53
- "androidEmulator": "Second actual run39193398410 proved process absence but FAILED waiting_schedule_marker. New/clear-task fix pending actual rerun; notification acceptance UNVERIFIED.",
59
+ "androidEmulator": "Third actualrun39194206345 FAILED adb_command_failed. Nonexistent named CLIflag identified and replaced with documented numeric-f0x10008000. Fourth actual run pending; notification acceptance UNVERIFIED.",
60
"physicalAndroid": "UNVERIFIED",
61
"realServerAcknowledgement": "UNVERIFIED — fixture explicitly simulates acknowledgement",
62
"safariIranRebootDozeSoundAndUserPermissionUI": "UNVERIFIED",
docs/operations/ANDROID_REMINDER_ACCEPTANCE.md
+3
-1
@@ -35,4 +35,6 @@ harness به serial صریح، تأیید محیط ساختگی، manifest debug
35
36
اولین اجرای واقعی39192545919 در اثبات بستهشدن پردازش شکست خورد؛ این شکست حفظ شده است. retry فرمان عادی، فقط در صورت PRESENT و با شرط ABSENT پیش از موعد اضافه شد. دلیل محتمل تأخیر رفتن Activity به پسزمینه است؛ علت runtime با اجرای اول اثبات نشده است. unit test موفق جای اجرای دوبارهٔ شبیهساز را نمیگیرد.
37
38
-اجرای دوم39193398410، بستهشدن پردازش را تأیید کرد ولی markerبعدی timeoutشد. مطابق رفتار Flutter3.47.6، initialrouteاز Intentاول خوانده میشود؛ بازکردن مجدد taskنگهداشتهشده میتواند routeقبلی را نگه دارد. ابزار فقط taskساختگی خودش را با `--activity-new-task --activity-clear-task`باز میکند؛ این کار force-stop، حذف preference یا لغو alarmنیست. نتیجهٔ runtimeباید با اجرای بعدی و همان کنترل بقای وضعیت/اعلان تأیید شود.
38
+اجرای دوم39193398410، بستهشدن پردازش را تأیید کرد ولی markerبعدی timeoutشد. مطابق رفتار Flutter3.47.6، initialrouteاز Intentاول خوانده میشود؛ بازکردن مجدد taskنگهداشتهشده میتواند routeقبلی را نگه دارد. ابزار فقط taskساختگی خودش را با `-f 0x10008000`باز میکند؛ این کار force-stop، حذف preference یا لغو alarmنیست. نتیجهٔ runtimeباید با اجرای بعدی و همان کنترل بقای وضعیت/اعلان تأیید شود.
39
+
40
+اجرای سوم39194206345با `adb_command_failed`متوقف شد. گزینهٔ نامگذاریشدهٔ NEW_TASKدر parserخطفرمان Android15وجود نداشت؛ اشتباه ابزار با `-f 0x10008000`طبق parserرسمی اصلاح شد و مدل آزمون هم گزینهٔ قبلی را رد میکند. اجراهای ناموفق، تأیید اعلان محسوب نمیشوند.